Skip to main content

SmartScout API Python Package

This Python package provides a convenient wrapper for the SmartScout API, allowing you to easily interact with SmartScout's powerful e-commerce analytics tools in your Python projects.

Features

  • Easy-to-use client for all SmartScout API endpoints
  • Type-safe request and response models
  • Automatic pagination handling
  • Comprehensive error handling

Installation

You can install the SmartScout API Python package using pip:

pip install smartscout-api

Quick Start

Here's a quick example of how to use the SmartScout API client:

from smartscout import SmartScoutAPIClient
from smartscout.models import SearchProductsRequest, MarketplaceId

# Initialize the client with your API key
client = SmartScoutAPIClient(api_key="your_api_key_here")

# Create a request to search for products
request = SearchProductsRequest(
    marketplace=MarketplaceId.US,
    brand_name="Example Brand",
    review_count={"min": 100}
)

# Make the API call
response = client.search_products(request)

# Process the results
for product in response.data:
    print(f"Product: {product.asin}, Title: {product.title}, Price: ${product.price}")

# If there are more pages, you can access them like this:
while response.paging.has_more_records:
    request.page.id = response.paging.next_page_id
    response = client.search_products(request)
    # Process the next page of results...

Available Methods

The SmartScoutAPIClient provides methods for all SmartScout API endpoints, including:

  • search_brands()
  • search_products()
  • search_search_terms()
  • search_sellers()
  • get_organic_ranks()
  • get_product_history_scope()
  • get_relevant_products()
  • get_subcategory_brands()
  • get_brand_sales_history()
  • get_brand_sales_history_by_subcategories()
  • get_brand_scope()
  • get_brand_scope_top_products()
  • get_relevant_search_terms()
  • get_search_term_history()

Each method corresponds to a specific API endpoint and accepts a request model as its parameter.

Error Handling

The package includes custom exceptions for various error scenarios:

  • SmartScoutAPIError: General API errors
  • AuthenticationError: Issues with API key authentication
  • RateLimitError: API rate limit exceeded
  • ValidationError: Request validation errors
  • ResourceNotFoundError: Requested resource not found
  • InsufficientPermissionsError: Lack of permissions for an action
  • ServiceUnavailableError: SmartScout service unavailable
  • RequestTimeoutError: API request timeout
  • InvalidRequestError: Invalid request parameters
  • UnexpectedResponseError: Unexpected API response format

You can catch these exceptions to handle different error scenarios in your code:

from smartscout.exceptions import SmartScoutAPIError, RateLimitError

try:
    response = client.search_products(request)
except RateLimitError:
    print("Rate limit exceeded. Please wait before making more requests.")
except SmartScoutAPIError as e:
    print(f"An API error occurred: {e.message}")

Documentation

For detailed information about the SmartScout API, including all available endpoints and request/response models, please refer to the official SmartScout API documentation.

Contributing

We welcome contributions to the SmartScout API Python package! Please see our contribution guidelines for more information on how to get started.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

If you encounter any issues or have questions about using the SmartScout API Python package, please open an issue on our GitHub repository.

For questions related to the SmartScout API itself or your SmartScout account, please contact SmartScout support directly.

Disclaimer

This package is not officially maintained by SmartScout. It is a community-developed wrapper for the SmartScout API.

Metadata

Release files for smartscout-api 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smartscout-api 0.1.1
File Size Uploaded
smartscout_api-0.1.1.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smartscout-api 0.1.1
File Interpreter ABI Platform
smartscout_api-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 33.1 kB

Release files / smartscout_api-0.1.1.tar.gz

Download URL smartscout_api-0.1.1.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
105e35b7b6340ec4afad13a688bd4877461b444978f9dd97a4c058da57c0f8d1
BLAKE2b-256 checksum
How to use checksums
34945d2fe66e432604ca04c1bc352e2551c9123c1b31213125154373ad385e7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / smartscout_api-0.1.1-py3-none-any.whl

Download URL smartscout_api-0.1.1-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3b7b0d24e02f72524e9bea1af2b40101b148814951a6a7555b58b41cabdf159
BLAKE2b-256 checksum
How to use checksums
c0a14c713e02ae5e7596a62347a4685f5f6c76ddeaf0dd64c419bef4f248d33e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page