Core APIs
...
Parameters
Core Requests

Search

4min
search parameters get get /request the search parameters are applicable when making a request with type=search to retrieve search results for an amazon domain the amazon domain is specified using the amazon domain parameter and the search term is specified in the search term parameter the parameters should be appended as querystring parameters to the product data api get http request search results are retrieved from the search results page https //www amazon com/s?k=memory+cards\&s=price desc rank on amazon for example, to request search results for the search term "memory cards" sorted by "high to low price", on amazon com , the request would be http https //api rainforestapi com/request?api key=demo\&type=search\&amazon domain=amazon com\&search term=memory+cards\&sort by=price high to lowcurl l get https //api rainforestapi com/request \\ d api key="demo" \\ d type="search" \\ d amazon domain="amazon com" \\ d search term="memory+cards" \\ d sort by="price low to high"const axios = require('axios'); // set up the request parameters const params = { api key "demo", type "search", amazon domain "amazon com", search term "memory cards", sort by "price high to low" } // make the http get request to rainforest api axios get('https //api rainforestapi com/request', { params }) then(response => { // print the json response from rainforest api console log(json stringify(response data, 0, 2)); }) catch(error => { // catch and print the error console log(error); })import requests import json \# set up the request parameters params = { 'api key' 'demo', 'type' 'search', 'amazon domain' 'amazon com', 'search term' 'memory cards', 'sort by' 'price high to low' } \# make the http get request to rainforest api api result = requests get('https //api rainforestapi com/request', params) \# print the json response from rainforest api print(json dumps(api result json()))\<?php \# set up the request parameters $querystring = http build query(\[ 'api key' => 'demo', 'type' => 'search', 'amazon domain' => 'amazon com', 'search term' => 'memory cards', 'sort by' => 'price high to low' ]); \# make the http get request to rainforest api $ch = curl init(sprintf('%s?%s', 'https //api rainforestapi com/request', $querystring)); curl setopt($ch, curlopt returntransfer, true); curl setopt($ch, curlopt followlocation, true); \# the following options are required if you're using an outdated openssl version \# more details https //www openssl org/blog/blog/2021/09/13/letsencryptrootcertexpire/ curl setopt($ch, curlopt ssl verifyhost, false); curl setopt($ch, curlopt ssl verifypeer, false); curl setopt($ch, curlopt timeout, 180); $api result = curl exec($ch); curl close($ch); \# print the json response from rainforest api echo $api result; ?> search parameters the following parameters are available for all requests made when type=search parameter required description amazon domain optional the amazon domain to retrieve search results from for a full list of supported amazon domains see supported amazon domains https //docs trajectdata com/rainforestapi/product data api/reference/amazon domains search term optional a search term to use to search products number of results optional specify the desired number of search results using number of results= param note you cannot request more results than what the search page returns fields optional use the fields param to declare search results you want to include in your result note only allows selecting top level objects and items under search results search fields should be specified as a comma separated list of field names, with nested fields being expressed in dot notation example fields=search results title,search results asin,search results price include products count optional include products count lets you choose how many of the top search results should have product requests run, instead of running a product request for every result note each product request counts as extra credit the base search costs 1 credit, and for every result included in include products count, an additional 1 credit is charged so if you set include products count = 10, the total cost will be 1 (search) + 10 (products) = 11 credits exmaple include products count=10 refinements optional a comma seperated list of refinement values to filter the search results by these allow you to refine your search by values such as "reviews rating 4 and over", "price range" and "brand" refinement values are returned in the refinements array of each type=search result refinement values are dynamic and change by category area or search term used if you wish to use refinements you should first issue a type=search request without specifying any refinements to retrieve a master list of the avaialble refinements for the given category area/search term you can then cache these refinement values for use on subsequent requests for example, to run a type=search request specifying two refinements with values p 85/2470955011 and p 36/2421886011 the value of the refinements parameter would be refinements=p 85/2470955011,p 36/2421886011 category id optional a category id to limit search results to you may supply any arbitary value in the category id parameter however we recommend using a category id returned from the categories api https //docs trajectdata com/rainforestapi/categories api/overview as these are known good category ids from amazon rainforest will use the category id in the following form https // amazon domain /s?node= category id note that pagination for top level categories is not supported by the amazon sites if you wish to iterate the contents of a category the recommended approach is to pick the lowest level categories to perform your iteration / pagination on sort by optional determines the sort order of search results to return valid values are most recent sort search results by newest arrivals price low to high sort search results by lowest to highest price price high to low sort search results by highest to lowest price featured sort search results by featured first average review sort search results by average customer review relevance sort search results by most relevant first applies only to audible amazon domains https //docs trajectdata com/rainforestapi/product data api/reference/amazon domains bestsellers sort search results by best sellers first applies only to audible amazon domains https //docs trajectdata com/rainforestapi/product data api/reference/amazon domains running time ascending sort search results by shortest running time first, from short to long applies only to audible amazon domains https //docs trajectdata com/rainforestapi/product data api/reference/amazon domains running time descending sort search results by shortest running time first, from long to short applies only to audible amazon domains https //docs trajectdata com/rainforestapi/product data api/reference/amazon domains title ascending sort search results alphabetically by title from a to z applies only to audible amazon domains https //docs trajectdata com/rainforestapi/product data api/reference/amazon domains title descending sort search results alphabetically by title from z to a applies only to audible amazon domains https //docs trajectdata com/rainforestapi/product data api/reference/amazon domains exclude sponsored optional whether to exclude sponsored search results (when set to exclude sponsored=true ) from the search results returned, or not defaults to false page optional the current page of search results to retrieve inspect the pagination total pages property in the search results https //docs trajectdata com/rainforestapi/product data api/results/search to see how many pages of search results are available max page optional use the max page parameter to get multiple pages of results in one request the api will automatically paginate through pages and concatenate the results into one response see the pagination https //docs trajectdata com/rainforestapi/product data api/pagination docs for more information url optional the amazon search results page url to retrieve search results from be sure to url encode the url parameter note the url parameter is supplied, the search term parameter cannot be used (as the url itself defines the search term used) direct search optional by default amazon will, if a spelling mistake is suspected in the search term , show search results for the corrected search term to disable this behaviour and search for the value in search term directly, without auto correcting it, set direct search=true next steps search results https //docs trajectdata com/rainforestapi/product data api/results/search