NAV

Datasets API
Amazon

shell

Introduction

Data API for Amazon is an API to retrieve publicly available data from Amazon. The API can return pre-scraped data or scrape data on demand via scrape endpoint. The API returns clean, structured JSON. The data can be uploaded to your cloud storage in JSONL format and can also be downloaded via provided links.

On-Demand Bulk Refresh

/scrape

curl -X POST "https://api.datasets.oxylabs.io/v1/amazon/scrape?api_key=<API_KEY>" \
-H "Content-Type: application/json" \
-d '{
  "dataset": "products",
  "products": ["14008351", "14008351"],
  "html": true,
  "destination": {
    "target": "S3",
    "bucket": "my-bucket",
    "prefix": "amazon-data"
  }
}'

Request Parameters

Parameter Description Required
dataset Dataset type. Available values: products Yes
     products ASINs (for example: 312623448). Parameter type is an array[]. Required if dataset is products
html Return raw HTML alongside parsed data No
destination Cloud storage configuration for results No
     target Cloud storage provider. Available values: GCP, AWS. No
     bucket Storage bucket name. No
     prefix Path prefix within bucket. No

The scrape endpoint supports uploading results to Amazon S3 or Google Cloud Storage. See the cloud storage permissions section below for setup instructions.

Cloud Storage Permissions

Amazon S3

To enable uploads to your S3 bucket:

  1. Go to AWS S3 Console
  2. Navigate to S3 > Storage > Bucket Name
  3. Go to Permissions > Bucket Policy
  4. Apply the bucket policy replacing YOUR_BUCKET_NAME with your bucket name

Google Cloud Storage

To enable uploads to your GCS bucket:

  1. Create a custom role with the storage.objects.create permission
  2. Assign it to the service account: oxylabs-datasets-uploader@oxyds-database-api-prod.iam.gserviceaccount.com

Utility Endpoints

/users/stats

curl "https://api.datasets.oxylabs.io/v1/users/stats?api_key=<API_KEY>"

Response:

{
  "data": [
    {
      "date": "2024-01-01",
      "credits_used": 3600
    },
    {
      "date": "2024-01-02",
      "credits_used": 7600
    },
    {
      "date": "2024-01-03",
      "credits_used": 720
    }
  ]
}

Query Parameters

Parameter Description Required
api_key Your API key Yes
shell