Mika Scraper / TokopediaSearch
Function: TokopediaSearch()
TokopediaSearch(
query
):Promise
<TokopediaProduct
[]>
Defined in: src/_other-scraper/tokopedia_search.ts:42
Scrapes search results from Tokopedia using the GraphQL API.
Parameters
query
string
The product keyword to search for on Tokopedia.
Returns
Promise
<TokopediaProduct
[]>
A promise that resolves to an array of product objects, each containing details about the search results.
Example
import { TokopediaSearch } from 'mika-scraper';
async function performSearch() {
try {
const products = await TokopediaSearch("laptop");
console.log(products);
} catch (error) {
console.error('Error fetching search results:', error);
}
}
performSearch();
Last updated on