Raffle API
Raffle's API allows you to seamlessly incorporate our search into your current search bar design, while retaining all the advantages and functionality.
export const fetchSearchResults = async (query: string) => {
const url = urlBuilder(routes.searchURL, {
uid,
query,
preview: "true",
device: "desktop",
"session-id": sessionId,
});
const response = await fetch(url);
const data = (await response.json()) as SearchResultsResponse;
return data.results;
};
export const fetchSummary = async (query: string) => {
const url = urlBuilder(routes.summaryURL, { uid, query });
const response = await fetch(url);
const data = await response.json();
return data as SummaryResponse;
};