# Amazon Sponsored Ads Scraper (`phone_number_scraper/amazon-sponsored-ads-scraper`) Actor

\[ 1k / 1$ ] Amazon Sponsored Ads Scraper to see which products advertise on an Amazon keyword, where and how often: multiple independent visits, grid and carousel ad placements, appearance rates and an ad-load summary. Analyze competitor ad strategy.

- **URL**: https://apify.com/phone_number_scraper/amazon-sponsored-ads-scraper.md
- **Developed by:** [Phone Number Scraper](https://apify.com/phone_number_scraper) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Amazon Sponsored Ads Scraper

Amazon Sponsored Ads Scraper shows which products advertise on an Amazon keyword, where their ads appear and how often. Amazon rotates its sponsored placements, so a single look at a search page tells you very little. Amazon Sponsored Ads Scraper visits every keyword several times, merges the sponsored placements it sees and returns one record per advertised product plus an ad-load summary for the keyword. 📣

It is made for Amazon sellers, brands, PPC agencies and market researchers who want to know who spends on a search term before they bid on it. The Actor covers 21 Amazon marketplaces, needs no Amazon account and lets you export results as JSON, CSV or Excel from the Apify dataset.

> **✨ Why use Amazon Sponsored Ads Scraper?**
>
> - See which competitors advertise on your Amazon keywords
> - Measure how often each ad appears across independent visits
> - Separate grid ads, carousel ads and brand banners
> - Get an honest ad-load summary, even when no ad shows up

### 🔹 Amazon Sponsored Ads Scraper Key Features

Amazon Sponsored Ads Scraper is built around sampling, because one page load of search results is never the full picture.

- 🔁 **Multiple independent visits:** every keyword is opened several times, each time as a fresh visitor, with 8 visits by default.
- 📍 **Placement detail:** page number, position on the page and a top, middle or bottom band for each ad.
- 📈 **Appearance rate:** the share of visits in which an advertised product was seen.
- 🧩 **Three placement types:** grid ads, carousel ads and brand banner or other sponsored widgets.
- 🏷️ **Advertiser details:** optional product-page lookup for brand, seller, category, sales rank and stock.
- 🎛️ **Filters:** ad type, minimum appearance rate, advertisers to keep and advertisers to skip.
- 🗺️ **Location control:** an optional US delivery ZIP code for amazon.com.
- 📅 **Repeatable:** run Amazon Sponsored Ads Scraper on a schedule to compare ad activity from week to week.
- 📊 **Keyword summary:** for each search term, visits with and without ads, unique advertised products and top advertised products.

> **📌 Good to know:** Amazon Sponsored Ads Scraper reports what an anonymous visitor sees. It does not show bids, budgets, clicks or ad spend, because Amazon does not publish them.

### 🔍 What Data You Can Extract with Amazon Sponsored Ads Scraper

The Amazon Sponsored Ads Scraper dataset holds two record types, separated by the `recordType` field:

- **ad:** one record per advertised product or widget, with title, ASIN, price, stars, reviews, placement and appearance data.
- **summary:** one record per keyword, with the ad load of that search term.

An ad record from Amazon Sponsored Ads Scraper can also carry the advertiser (brand and seller), category, sales ranks, stock status, delivery text, badges and the full list of appearances. Fields that Amazon does not show for an ad are null.

### 🚀 How to Use Amazon Sponsored Ads Scraper

Using Amazon Sponsored Ads Scraper takes only a few steps:

1. Open Amazon Sponsored Ads Scraper on Apify and add one or more keywords.
2. Choose the Amazon marketplace and, optionally, a department such as electronics or garden.
3. Set the number of visits per keyword and the number of result pages per visit.
4. Add filters if you only need certain ad types or advertisers, then start the run.
5. Open the "Advertised products", "Ad details" or "Keyword ad load" view, or export the dataset.

You can also schedule Amazon Sponsored Ads Scraper to repeat the same keywords every week.

### 🧭 How to Find Which Products Advertise on an Amazon Keyword with Amazon Sponsored Ads Scraper

Enter the exact phrase shoppers type, for example "running shoes". Amazon Sponsored Ads Scraper opens the search results several times, finds every placement labelled Sponsored and groups the placements by product.

Read the `appearanceRatePercent` field first: an ad seen in 6 of 8 visits is a steady advertiser, while one seen once is occasional. Then use `placement`, `bestPageNumber` and `bestPositionOnPage` to see where the ad sits on the page; a lower position number means closer to the top.

Amazon Sponsored Ads Scraper sorts the ad records by how often each product was seen, so the steadiest advertisers come first.

> **🧪 Example run:** with Amazon Sponsored Ads Scraper, keyword "running shoes", marketplace amazon.com, 8 visits, one result page per visit, ZIP code 10001. You get one summary record and up to 15 ad records, with the most frequent advertisers listed first.

### ❓ Can You Track Competitor Amazon Ads and Ad Spend with Amazon Sponsored Ads Scraper?

You can track who advertises, where and how often. You cannot see their spend. Amazon Sponsored Ads Scraper reports visible placements, not bids, budgets or conversions.

Amazon Sponsored Ads Scraper cannot force Amazon to show ads: anonymous visitors only receive ads on some page loads, so two runs can differ. If no ad appears in the first visits, sampling continues up to the maximum and the keyword summary says so honestly instead of returning an empty result.

### 🎯 Amazon Sponsored Ads Scraper Use Cases

> **💼 Typical Amazon Sponsored Ads Scraper uses**
>
> - Competitor ad research
> - Keyword competitiveness checks
> - Brand presence monitoring
> - PPC planning

- Check which brands advertise on a keyword before you launch Amazon ads of your own.
- Measure the ad load of a keyword with Amazon Sponsored Ads Scraper, using visits with ads against visits without ads.
- Spot brands whose ads show on your branded search terms.
- Compare ad intensity across marketplaces or departments.
- Use Amazon Sponsored Ads Scraper weekly to track how advertisers change over time.

### 🛠️ Amazon Sponsored Ads Scraper Input

Only `keywords` is required. All other Amazon Sponsored Ads Scraper fields have defaults.

| Field | Type | Default | What it does |
| --- | --- | --- | --- |
| `keywords` | array | required | Amazon search phrases whose ads you want to see |
| `marketplace` | select | `amazon.com` | Amazon site to search |
| `department` | text | empty | Optional search department such as electronics, garden, fashion or `aps` for all |
| `deliveryZip` | text | empty | 5-digit US ZIP code, amazon.com only |
| `samples` | integer | 8 | Independent visits per keyword |
| `maxSamples` | integer | 24 | Upper limit of visits when no ad has been seen yet |
| `maxPages` | integer | 1 | Result pages per visit, 1 to 50 |
| `maxItems` | integer | 15 | Maximum number of ad records in the whole run |
| `adTypes` | array | all | `sponsored_product`, `sponsored_carousel_product`, `sponsored_brand_or_other` |
| `minAppearanceRatePercent` | number | empty | Keep ads seen in at least this percent of visits (0 to 100) |
| `includeBrands` | array | none | Keep only these advertisers |
| `excludeBrands` | array | none | Skip these advertisers |
| `includeProductDetails` | boolean | true | Open advertised product pages for advertiser, rank and stock |
| `maxConcurrency` | integer | 3 | Keywords processed in parallel, 1 to 10 |

The three `adTypes` values are grid ads, carousel ads and brand banner or other widgets. Brand names are matched case-insensitively against the advertiser and the seller.

#### 📥 Amazon Sponsored Ads Scraper Input JSON Example

```json
{
  "keywords": ["running shoes", "protein powder"],
  "marketplace": "amazon.com",
  "department": "aps",
  "deliveryZip": "10001",
  "samples": 8,
  "maxSamples": 24,
  "maxPages": 1,
  "maxItems": 30,
  "adTypes": ["sponsored_product", "sponsored_carousel_product"],
  "minAppearanceRatePercent": 10,
  "excludeBrands": ["Amazon Basics"],
  "includeProductDetails": true,
  "maxConcurrency": 3
}
```

### 📊 Amazon Sponsored Ads Scraper Output

Each Amazon Sponsored Ads Scraper ad record contains these fields. Values that Amazon does not show are null.

- `recordType`, `keyword`, `adType`, `asin`, `title`, `url`, `thumbnailImage`
- `brand`, `soldBy`, `sellerId`, `productDetails` (category, sales ranks, stock, Amazon's Choice flag)
- `price`, `listPrice`, `stars`, `reviewsCount`, `boughtInPastMonth`, `badges`, `couponText`, `isPrime`, `delivery`
- `placement`, `placementCode`, `carouselTitle`, `bestPageNumber`, `bestPositionOnPage`, `bestCarouselPosition`
- `timesSeen`, `visitsSeen`, `visitsTotal`, `appearanceRatePercent`, `appearances`
- `adExplanation`, `storeUrl`, `widgetText`, `productAsins`, `hasVideo` for banner-style widgets
- `domain`, `loadedCountryCode`, `scrapedAt`

The Amazon Sponsored Ads Scraper summary record adds `visits`, `pagesLoaded`, `resultCardsScanned`, `adPlacementsPerVisit`, `avgAdPlacementsPerVisit`, `visitsWithAds`, `visitsWithoutAds`, `uniqueAdvertisedProducts`, `gridAds`, `carouselAds`, `otherSponsoredWidgets`, `carouselTitles`, `topAdvertised` and `note`.

#### 🧩 What Each Ad Type Returns

Amazon Sponsored Ads Scraper labels every placement with one of three ad types:

| Ad type | What it is | Typical fields |
| --- | --- | --- |
| `sponsored_product` | An ad card inside the result grid | `asin`, `title`, `price`, `placement`, `bestPositionOnPage` |
| `sponsored_carousel_product` | A product inside a sponsored carousel | `carouselTitle`, `bestCarouselPosition`, `asin`, `price` |
| `sponsored_brand_or_other` | A banner or video widget without product cards | `title` (headline), `widgetText`, `storeUrl`, `productAsins`, `hasVideo` |

Widget records have no ASIN and no placement band, so those fields are null.

#### 📤 Amazon Sponsored Ads Scraper Output JSON Example

```json
{
  "recordType": "ad",
  "keyword": "running shoes",
  "adType": "sponsored_product",
  "asin": "B0EXAMPLE2",
  "title": "Men's Example Road Running Shoe",
  "url": "https://www.amazon.com/dp/B0EXAMPLE2",
  "carouselTitle": null,
  "brand": "Example Brand",
  "soldBy": "Example Store",
  "sellerId": null,
  "price": { "value": 89.95, "currency": "USD", "formatted": "$89.95" },
  "listPrice": null,
  "stars": 4.5,
  "reviewsCount": 1183,
  "boughtInPastMonth": "50+ bought in past month",
  "badges": [],
  "couponText": null,
  "isPrime": null,
  "delivery": "FREE delivery Tuesday",
  "placement": "top",
  "placementCode": "sp_atf",
  "bestPageNumber": 1,
  "bestPositionOnPage": 3,
  "bestCarouselPosition": null,
  "timesSeen": 2,
  "visitsSeen": 2,
  "visitsTotal": 8,
  "appearanceRatePercent": 25.0,
  "appearances": [
    { "sampleNumber": 1, "pageNumber": 1, "positionOnPage": 3, "placementCode": "sp_atf", "placement": "top", "carouselPosition": null },
    { "sampleNumber": 5, "pageNumber": 1, "positionOnPage": 4, "placementCode": "sp_atf", "placement": "top", "carouselPosition": null }
  ],
  "adExplanation": "You're seeing this ad based on the product's relevance to your search query.",
  "storeUrl": null,
  "widgetText": null,
  "productAsins": null,
  "hasVideo": null,
  "productDetails": {
    "brand": "Example Brand",
    "soldBy": "Example Store",
    "sellerId": null,
    "shipsFrom": "Amazon",
    "category": "Clothing, Shoes & Jewelry › Men › Shoes › Athletic › Running",
    "bestsellerRanks": [
      { "rank": 2740, "category": "Clothing, Shoes & Jewelry", "url": "https://www.amazon.com/gp/bestsellers/fashion" }
    ],
    "inStock": true,
    "monthlyPurchaseVolume": "50+ bought in past month",
    "couponText": null,
    "dealBadge": null,
    "isAmazonChoice": false,
    "reviewsCount": 1183,
    "stars": 4.5
  },
  "thumbnailImage": "https://m.media-amazon.com/images/I/example._AC_UL320_.jpg",
  "domain": "amazon.com",
  "loadedCountryCode": "US",
  "scrapedAt": "2026-11-12T12:49:06Z"
}
```

The keyword summary record looks like this:

```json
{
  "recordType": "summary",
  "keyword": "running shoes",
  "domain": "amazon.com",
  "loadedCountryCode": "US",
  "visits": 8,
  "pagesLoaded": 8,
  "resultCardsScanned": 384,
  "adPlacementsPerVisit": [0, 9, 0, 4, 0, 10, 0, 5],
  "avgAdPlacementsPerVisit": 3.5,
  "visitsWithAds": 4,
  "visitsWithoutAds": 4,
  "uniqueAdvertisedProducts": 12,
  "gridAds": 4,
  "carouselAds": 8,
  "otherSponsoredWidgets": 0,
  "carouselTitles": ["Trending now", "Seen on social media"],
  "topAdvertised": [
    { "asin": "B0EXAMPLE2", "title": "Men's Example Road Running Shoe", "visitsSeen": 2 }
  ],
  "note": null,
  "scrapedAt": "2026-11-12T12:49:02Z"
}
```

#### 🔎 Reading the Example Records

- The summary shows 8 visits, 4 with ads and 4 without, so ads appeared in about every second visit.
- `adPlacementsPerVisit` lists the ad count of each visit in order, here 0, 9, 0, 4, 0, 10, 0 and 5.
- The example shoe was seen in 2 of 8 visits, which gives an appearance rate of 25.0 percent, both times in the top band at positions 3 and 4.
- `topAdvertised` names up to five of the steadiest products, and `carouselTitles` shows which carousels ran.

#### 🔗 More Input Examples

Track one advertiser on a keyword with Amazon Sponsored Ads Scraper and read its ads in more depth:

```json
{
  "keywords": ["running shoes"],
  "includeBrands": ["Example Brand"],
  "samples": 12,
  "maxPages": 2,
  "minAppearanceRatePercent": 20,
  "maxItems": 20
}
```

Sample a German search term for carousels and brand banners only, without product pages:

```json
{
  "keywords": ["laufschuhe herren"],
  "marketplace": "amazon.de",
  "adTypes": ["sponsored_carousel_product", "sponsored_brand_or_other"],
  "includeProductDetails": false,
  "samples": 10
}
```

### 💰 Amazon Sponsored Ads Scraper Pricing

> **💵 $1.49 per 1,000 results**
>
> Amazon Sponsored Ads Scraper uses pay-per-result pricing: each ad record and each keyword summary record saved to the dataset counts as one result.

- The `maxItems` field limits the number of ad records in an Amazon Sponsored Ads Scraper run, and the summary record of each keyword is added on top.
- Fewer visits and one result page per visit keep Amazon Sponsored Ads Scraper runs short.
- Apify platform plans, free credits and usage limits apply as usual.

### 💡 Tips and Best Practices for Amazon Sponsored Ads Scraper

- Keep at least 8 visits in Amazon Sponsored Ads Scraper, because Amazon shows ads on only some page loads.
- Raise `samples` for competitive keywords to get steadier appearance rates.
- Set a ZIP code on amazon.com when you compare ads for one delivery area.
- Keep `includeProductDetails` on in Amazon Sponsored Ads Scraper if you need the advertiser name for each ad.
- Use `minAppearanceRatePercent` to hide one-off ads and focus on steady advertisers.
- Run the same keywords on a schedule and compare the datasets over time to see how advertisers change.

> **⚠️ Important:** Amazon Sponsored Ads Scraper is a sampling tool. Appearance rates are estimates from your visits, and results differ between runs and delivery locations. A run that reaches its time limit keeps the records collected so far.

### 📐 How to Read the Appearance Rate

Amazon Sponsored Ads Scraper stores the rate in `appearanceRatePercent`. As a rule of thumb, an ad seen in most visits is a steady advertiser, an ad seen in roughly a quarter to a half of visits is a regular one, and an ad seen once is occasional. With 8 visits one sighting equals 12.5 percent, so raise `samples` before drawing conclusions about rare ads.

The Amazon Sponsored Ads Scraper summary record gives the context: `visitsWithAds` against `visitsWithoutAds` shows how reliably Amazon served ads to a visitor on that keyword. The summary describes everything seen, even when your filters hide some ad records.

### 📅 Scheduling and Data Quality

Schedule Amazon Sponsored Ads Scraper in Apify to repeat the same keywords weekly, and attach a webhook if another tool should react when a run ends. Every record carries `scrapedAt`, so exports from different weeks can be compared.

- Prices, currency and availability follow the marketplace and the visitor's location.
- `appearanceRatePercent` is rounded to one decimal place.
- If an ad shows a field in one visit but not in another, the value that was seen is kept.

### 🩺 Troubleshooting Amazon Sponsored Ads Scraper Results

- **No ad records for a keyword:** Amazon showed no sponsored placement in any visit. Read the `note` field of the summary, then try more `samples` or another delivery ZIP code.
- **`brand` and `soldBy` are null:** `includeProductDetails` is off, so Amazon Sponsored Ads Scraper did not open product pages. Brand filters open them automatically.
- **Fewer ads than `maxItems`:** the keyword simply had fewer advertisers, or `adTypes` and `minAppearanceRatePercent` removed some.
- **Different ads between runs:** Amazon rotates ads per visit and per location.
- **`deliveryZip` ignored:** it works only on amazon.com, and other marketplaces ignore it.

### 🗂️ Which Amazon Actor Should You Use?

- Choose Amazon Sponsored Ads Scraper to see who advertises on a keyword and how often.
- Choose Amazon Search Results Scraper for the ranked product listings of a keyword search.
- Choose Amazon Keyword Rank Tracker to follow where your own products rank for a keyword.
- Choose Amazon Product Scraper for full details of one advertised product.

### ❓ Frequently Asked Questions

#### 🔹 What data does Amazon Sponsored Ads Scraper return?

Amazon Sponsored Ads Scraper returns advertised products with price, rating, placement, appearance rate and optional advertiser details, plus one summary per keyword.

#### 🔹 Can I see which brands advertise on an Amazon keyword with Amazon Sponsored Ads Scraper?

Yes. Keep product details on and read the `brand` and `soldBy` fields of each ad record.

#### 🔹 Why did Amazon Sponsored Ads Scraper return no ads for my keyword?

Amazon shows sponsored placements to anonymous visitors only intermittently. The summary record explains when no ad was seen in any visit.

#### 🔹 What is the appearance rate in Amazon Sponsored Ads Scraper?

It is the percentage of visits in which the advertised product was seen, shown in `appearanceRatePercent`.

#### 🔹 Can I filter ads by advertiser in Amazon Sponsored Ads Scraper?

Yes. Use `includeBrands` to keep selected advertisers or `excludeBrands` to skip them. Amazon product pages are opened to learn the advertiser.

#### 🔹 Does the delivery ZIP code work on every Amazon site?

No. `deliveryZip` works for amazon.com with 5-digit US ZIP codes and is ignored on other marketplaces.

#### 🔹 Can Amazon Sponsored Ads Scraper scrape several Amazon marketplaces?

Each run uses one marketplace. Start one run per Amazon site to compare countries.

#### 🔹 Does Amazon Sponsored Ads Scraper show how much competitors spend?

No. Amazon does not publish bids or budgets, so Amazon Sponsored Ads Scraper reports only visible placements and how often they appear.

#### 🔹 Can I scrape several keywords in one Amazon Sponsored Ads Scraper run?

Yes. Amazon Sponsored Ads Scraper accepts as many keywords as you need. Each keyword gets its own summary record, and `maxItems` limits the ad records across the whole run.

#### 🔹 How many visits does Amazon Sponsored Ads Scraper make per keyword?

The number set in `samples`, 8 by default. If no ad has been seen yet, it keeps visiting up to `maxSamples`.

#### 🔹 Can I find brand banners and video ads with Amazon Sponsored Ads Scraper?

Yes. Banner and video widgets appear as `sponsored_brand_or_other` records with their headline, text and store link.

### 🤝 Support

Questions about Amazon Sponsored Ads Scraper, a keyword that shows few ads or a feature request? Send a short message with your input and the run link.

- contact me by email : alphascraper69@gmail.com

# Actor input Schema

## `keywords` (type: `array`):

Search phrases whose ads you want to see.

## `marketplace` (type: `string`):

Amazon site to use. It is used for plain ASINs, keywords and names; a full Amazon URL always keeps its own marketplace. Prices, currency and availability follow the marketplace and the visitor's location.

## `department` (type: `string`):

Optional search department (Amazon's 'search-alias' / category dropdown) such as electronics, garden, fashion, stripbooks, toys-and-games or aps for all departments. Empty searches every department.

## `deliveryZip` (type: `string`):

US ZIP code (5 digits) for amazon.com, chosen the way a visitor does with the 'Deliver to' link before scraping: ads, prices and availability depend on the delivery location. Leave empty to keep the location Amazon assigns to your network. Ignored, with a warning, on other marketplaces.

## `samples` (type: `integer`):

Independent visits per keyword (each one a fresh browser session).

## `maxSamples` (type: `integer`):

Upper limit of visits; sampling goes past 'Visits per keyword' only while no ad has been seen yet.

## `maxPages` (type: `integer`):

How many search result pages are walked in every visit (live Next page link).

## `maxItems` (type: `integer`):

Maximum number of ad records in the whole run.

## `adTypes` (type: `array`):

Keep only these placement types: ad cards in the result grid, products in sponsored carousels, or other sponsored widgets (brand banner / video). Leave empty for all.

## `minAppearanceRatePercent` (type: `number`):

Keep only ads that appeared in at least this percent of the visits.

## `includeBrands` (type: `array`):

Keep only ads of these brands / sellers (case-insensitive; the advertiser is known when product pages are opened).

## `excludeBrands` (type: `array`):

Skip ads of these brands / sellers (case-insensitive).

## `includeProductDetails` (type: `boolean`):

Open every advertised product page to name the advertiser (brand, seller) and add rank, category and stock.

## `maxConcurrency` (type: `integer`):

How many input items (keywords, URLs, ASINs, profiles ...) are processed at the same time, each in its own browser. A higher value finishes faster but needs more memory (about 600 MB per browser - the run never starts more browsers than its memory allows) and sends more simultaneous requests to Amazon; 2 to 5 is a good range.

## Actor input object example

```json
{
  "keywords": [
    "running shoes",
    "protein powder"
  ],
  "marketplace": "amazon.com",
  "department": "electronics",
  "deliveryZip": "10001",
  "samples": 8,
  "maxSamples": 24,
  "maxPages": 1,
  "maxItems": 15,
  "includeBrands": [
    "Nike"
  ],
  "excludeBrands": [
    "Amazon Basics"
  ],
  "includeProductDetails": true,
  "maxConcurrency": 3
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [
        "running shoes"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("phone_number_scraper/amazon-sponsored-ads-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "keywords": ["running shoes"] }

# Run the Actor and wait for it to finish
run = client.actor("phone_number_scraper/amazon-sponsored-ads-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keywords": [
    "running shoes"
  ]
}' |
apify call phone_number_scraper/amazon-sponsored-ads-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,phone_number_scraper/amazon-sponsored-ads-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/AOfTIGJ5F1cYWAnoE/builds/rtambXKZVhcXalIaO/openapi.json
