Skip to content

Commit f08d566

Browse files
author
vs
committed
add amazon params
1 parent d1ad07e commit f08d566

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

outscraper/api_client.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ def phones_enricher(self, query: Union[list, str], fields: Union[list, str] = No
555555

556556
raise Exception(f'Response status code: {response.status_code}')
557557

558-
def amazon_products(self, query: Union[list, str], limit: int = 24, fields: Union[list, str] = None, async_request: bool = False,
558+
def amazon_products(self, query: Union[list, str], limit: int = 24, domain: str = 'amazon.com', postal_code: str = '11201', fields: Union[list, str] = None, async_request: bool = False,
559559
ui: bool = None, webhook: bool = None
560560
) -> Union[list, dict]:
561561
'''
@@ -566,6 +566,8 @@ def amazon_products(self, query: Union[list, str], limit: int = 24, fields: Unio
566566
Parameters:
567567
query (list | str): Amazon product or summary pages URLs.
568568
limit (int): The parameter specifies the limit of products to get from one query (in case of using summary pages).
569+
domain (str): The parameter specifies Amazon domain to use ("amazon.com", "amazon.co.uk", "amazon.ca", "amazon.de", "amazon.es", "amazon.fr", "amazon.it", "amazon.in", "amazon.nl", "amazon.se", "amazon.sa", "amazon.com.mx", "amazon.com.br", "amazon.co.jp", "amazon.pl").
570+
postal_code (str): The parameter specifies the postal code for delivery.
569571
fields (list | str): Parameter defines which fields you want to include with each item returned in the response. By default, it returns all fields.
570572
async_request (bool): Parameter defines the way you want to submit your task to Outscraper. It can be set to `False` (default) to send a task and wait until you got your results, or `True` to submit your task and retrieve the results later using a request ID with `get_request_archive`. Each response is available for `2` hours after a request has been completed.
571573
ui (bool): Parameter defines whether a task will be executed as a UI task. This is commonly used when you want to create a regular platform task with API. Using this parameter overwrites the async_request parameter to `True`.
@@ -581,6 +583,8 @@ def amazon_products(self, query: Union[list, str], limit: int = 24, fields: Unio
581583
response = requests.get(f'{self._api_url}/amazon/products-v2', params={
582584
'query': queries,
583585
'limit': limit,
586+
'domain': domain,
587+
'postal_code': postal_code,
584588
'async': wait_async,
585589
'fields': parse_fields(fields),
586590
'ui': ui,
@@ -590,7 +594,7 @@ def amazon_products(self, query: Union[list, str], limit: int = 24, fields: Unio
590594
return self._handle_response(response, wait_async, async_request)
591595

592596
def amazon_reviews(self, query: Union[list, str], limit: int = 10, sort: str = 'helpful', filter_by_reviewer: str = 'all_reviews',
593-
filter_by_star: str = 'all_stars', fields: Union[list, str] = None, async_request: bool = False, ui: bool = None, webhook: bool = None
597+
filter_by_star: str = 'all_stars', domain: str = None, fields: Union[list, str] = None, async_request: bool = False, ui: bool = None, webhook: bool = None
594598
) -> Union[list, dict]:
595599
'''
596600
Returns reviews from Amazon products.
@@ -601,6 +605,7 @@ def amazon_reviews(self, query: Union[list, str], limit: int = 10, sort: str = '
601605
sort (str): Parameter specifies one of the sorting types. Available values: "helpful", and "recent".
602606
filter_by_reviewer (str): The parameter specifies one of the reviewer filter types (All reviewers / Verified purchase only). Available values: "all_reviews", and "avp_only_reviews".
603607
filter_by_star (str): The parameter specifies one of the filter types by stars. Available values: "all_stars", "five_star", "four_star", "three_star", "two_star", "one_star", "positive", and "critical".
608+
domain (str): The parameter specifies Amazon domain to use ("amazon.com", "amazon.co.uk", "amazon.ca", "amazon.de", "amazon.es", "amazon.fr", "amazon.it", "amazon.in", "amazon.nl", "amazon.se", "amazon.sa", "amazon.com.mx", "amazon.com.br", "amazon.co.jp", "amazon.pl").
604609
fields (list | str): Parameter defines which fields you want to include with each item returned in the response. By default, it returns all fields.
605610
async_request (bool): Parameter defines the way you want to submit your task to Outscraper. It can be set to `False` (default) to send a task and wait until you got your results, or `True` to submit your task and retrieve the results later using a request ID with `get_request_archive`. Each response is available for `2` hours after a request has been completed.
606611
ui (bool): Parameter defines whether a task will be executed as a UI task. This is commonly used when you want to create a regular platform task with API. Using this parameter overwrites the async_request parameter to `True`.
@@ -619,6 +624,7 @@ def amazon_reviews(self, query: Union[list, str], limit: int = 10, sort: str = '
619624
'sort': sort,
620625
'filterByReviewer': filter_by_reviewer,
621626
'filterByStar': filter_by_star,
627+
'domain': domain,
622628
'async': wait_async,
623629
'fields': parse_fields(fields),
624630
'ui': ui,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def readme():
88

99
setup(
1010
name='outscraper',
11-
version='5.2.1',
11+
version='5.3.0',
1212
description='Python bindings for the Outscraper API',
1313
long_description=readme(),
1414
classifiers = ['Programming Language :: Python',

0 commit comments

Comments
 (0)