# B\&H Photo Scraper (`codingfrontend/b-h-photo-scraper`) Actor

Extract public B\&H Photo product metadata, prices, availability, ratings, and product links from supplied pages.

- **URL**: https://apify.com/codingfrontend/b-h-photo-scraper.md
- **Developed by:** [Coding Frontned](https://apify.com/codingfrontend) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 96.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 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.

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

### What does B\&H Photo Scraper do?

B\&H Photo Scraper reads public product pages on [B\&H Photo](https://www.bhphotovideo.com/) and follows product links from supplied category or search pages to collect structured product details. It returns product identity, price, availability and ratings, and can also collect complete overview sections, grouped specifications, images, videos, box contents, manuals, firmware notices, compatible models, variant choices and published buying/warranty offers. It does not sign in, solve access challenges, or retrieve private account or order data.

### Why use this Actor?

Use it to build a small product catalog, compare public product details, or save product-page data for research. Give it a B\&H category, search, or product page URL. From a listing, the Actor visits product pages in page order to collect detailed product information. A direct product URL reads only that product, without crawling recommendations. It does not search by keyword or automatically visit the next listing page; provide additional page URLs when needed.

### How to start a run

1. Open the Actor and select the **Input** tab.
2. Add one or more public B\&H Photo URLs in **B\&H Photo URLs**. Adjust the product limit or request settings if needed.
3. Click **Start**.
4. When the run finishes, open **Results** to view or download product records. Open **Output summary** for the run status and saved-record count.

All input fields are optional. If you leave out every URL field, the Actor starts at the B\&H Photo home page and follows available product links. For a predictable small run, supply a specific product or category page.

### Input fields

#### URLs

| Field | Type | Required? | Default | What it does |
| --- | --- | --- | --- | --- |
| `startUrls` | Array of URL strings | Optional | `https://www.bhphotovideo.com/` | Main field for one or more public B\&H Photo category, search, or product pages. Maximum 50 entries. |
| `url` | URL string | Optional | None | Compatibility alias for one URL. Prefer `startUrls` for new inputs. |
| `urls` | Array of URL strings | Optional | None | Compatibility alias for a list of URLs. Prefer `startUrls` for new inputs. Maximum 50 entries. |

If you provide more than one URL field, the Actor combines their values in this order: `startUrls`, `urls`, then `url`. It normalizes and removes duplicate URLs, preserving the first occurrence. The total across all three fields cannot exceed 50 URLs. The `startUrls` field is recommended for new inputs.

#### Result and request limits

| Field | Type | Required? | Default | What it does |
| --- | --- | --- | --- | --- |
| `maxItems` | Integer | Optional | `10` | Maximum number of unique product records saved across all URLs. Also bounds additional product detail requests to this many unique pages per run. Range: 1–100. Reaching this limit is a normal completed run. |
| `timeoutSecs` | Integer | Optional | `30` | Timeout for each supplied page or product detail request, in seconds. Range: 5–120. |
| `maxRetries` | Integer | Optional | `2` | Maximum retries for temporary request failures and server errors. Range: 0–3. Access challenges are not retried. |
| `maxResponseBytes` | Integer | Optional | `5000000` | Maximum HTML response size per page. Range: 10,000–10,000,000 bytes. |

The result limit applies to the whole run, not separately to each URL. Duplicate product URLs are saved once; tracking links and review/specification links to the same product share one detail request. Detail pages are read one at a time with a short pause between requests. If some detail requests fail, the run can return fewer products than requested. The Actor does not offer keyword search, price filters, or sorting controls; choose the pages you want it to read.

#### Input examples

A small run from a product page:

```json
{
  "startUrls": ["https://www.bhphotovideo.com/c/product/1667800-REG/sony_ilce_7m4_b_alpha_a7_iv_mirrorless.html"],
  "maxItems": 1
}
```

Read more than one page, with one result limit for the whole run:

```json
{
  "startUrls": [
    "https://www.bhphotovideo.com/c/product/1667800-REG/sony_ilce_7m4_b_alpha_a7_iv_mirrorless.html",
    "https://www.bhphotovideo.com/c/buy/Mirrorless-Camera-Lenses/ci/17912/N/4196380428"
  ],
  "urls": ["https://www.bhphotovideo.com/c/product/1667800-REG/sony_ilce_7m4_b_alpha_a7_iv_mirrorless.html"],
  "maxItems": 20,
  "timeoutSecs": 45,
  "maxRetries": 1
}
```

Use the compatibility alias for one URL:

```json
{
  "url": "https://www.bhphotovideo.com/c/product/1667800-REG/sony_ilce_7m4_b_alpha_a7_iv_mirrorless.html",
  "maxItems": 1
}
```

Use the compatibility alias for multiple URLs:

```json
{
  "urls": [
    "https://www.bhphotovideo.com/c/product/1667800-REG/sony_ilce_7m4_b_alpha_a7_iv_mirrorless.html",
    "https://www.bhphotovideo.com/c/buy/Mirrorless-Camera-Lenses/ci/17912/N/4196380428"
  ],
  "maxItems": 10,
  "maxResponseBytes": 5000000
}
```

Only public `bhphotovideo.com` URLs are accepted. Unsupported input fields are rejected.

### Dataset output

Each dataset item is a business product record. Product **name** and product-page **URL** are required, along with at least one additional detail. Listing links are followed to their product pages for these fields. If a listing already exposes a valid product record, a detail lookup can fill its missing fields; a failed lookup keeps that base record. A detail that is missing from both pages is omitted. Detailed sections, specifications, media, box contents and compatibility remain nested within the same product record. Enrichment never creates additional dataset rows.

The values below are **illustrative** and do not represent a verified live scrape:

```json
{
  "name": "Illustrative Mirrorless Camera",
  "sku": "CAM-EXAMPLE-01",
  "brand": "Example Optics",
  "description": "Illustrative camera introduction for the output format.",
  "url": "https://www.bhphotovideo.com/c/product/example-camera.html",
  "price": 749.99,
  "currency": "USD",
  "availability": "https://schema.org/InStock",
  "ratingValue": 4.6,
  "reviewCount": 18,
  "productId": "123456",
  "mpn": "CAM-PART-01",
  "gtin12": "012345678905",
  "brandDetails": {
    "url": "https://www.bhphotovideo.com/c/browse/Example-Optics/ci/12345",
    "logoUrl": "https://www.bhphotovideo.com/images/manufacturers/example.svg",
    "isAuthorizedDealer": true
  },
  "keyFeatures": [
    "Full-frame sensor",
    "In-body stabilization"
  ],
  "overview": [
    {
      "title": "Sensor and Processor",
      "sections": [
        {
          "title": "Imaging performance",
          "text": "Detailed source description.",
          "html": "<p>Detailed source description.</p>",
          "note": "Optional operating note.",
          "media": [
            {
              "name": "Product demonstration",
              "url": "https://www.youtube.com/embed/exampleVideo",
              "type": "YOUTUBE",
              "durationSeconds": 120
            }
          ]
        }
      ]
    }
  ],
  "specifications": [
    {
      "name": "Imaging",
      "isKeySpec": true,
      "specs": [
        {
          "name": "ISO Sensitivity",
          "value": [
            "Photo",
            "Native: 100 to 51,200"
          ],
          "note": "Additional crop in some modes."
        }
      ]
    }
  ],
  "imageGroups": [
    {
      "name": "Illustrative Mirrorless Camera",
      "items": [
        {
          "url": "https://static.bhphoto.com/images/images2500x2500/example.jpg",
          "width": 2500,
          "height": 2500,
          "caption": "Front view"
        }
      ]
    }
  ],
  "videos": [
    {
      "name": "Product demonstration",
      "url": "https://www.youtube.com/embed/exampleVideo",
      "type": "YOUTUBE",
      "durationSeconds": 120
    }
  ],
  "includedItems": [
    {
      "name": "Rechargeable battery",
      "quantity": 1,
      "productId": "1333269",
      "url": "https://www.bhphotovideo.com/c/product/example-battery.html",
      "note": "Included accessory.",
      "includedItems": [
        {
          "name": "Battery cap",
          "quantity": 1
        }
      ]
    }
  ],
  "resources": [
    {
      "title": "User Manual",
      "url": "https://www.bhphotovideo.com/lit_files/example.pdf",
      "sizeBytes": 4807674
    }
  ],
  "categoryPath": [
    {
      "id": "16158",
      "name": "Mirrorless Cameras",
      "url": "https://www.bhphotovideo.com/c/buy/Mirrorless-Cameras/ci/16158/N/4288586281"
    }
  ],
  "offer": {
    "itemCondition": "https://schema.org/NewCondition",
    "priceValidUntil": null,
    "originalPrice": 999.99,
    "savings": [
      {
        "type": "instant",
        "amount": 250
      }
    ]
  },
  "firmwareUpdates": [
    {
      "title": "Firmware Update v6.01",
      "url": "https://www.sony.com/electronics/support/example/downloads",
      "date": "2026-01-15T05:00:00.000Z",
      "version": "v6.01",
      "description": "Source firmware release notes."
    }
  ],
  "compatibleModels": [
    {
      "categoryName": "Mirrorless Cameras",
      "models": [
        "Sony Alpha A7 IV"
      ]
    }
  ],
  "cannotShipTo": [
    "CANADA"
  ],
  "configurations": [
    {
      "name": "Lens Options",
      "options": [
        {
          "name": "With Lens",
          "productId": "123456",
          "sku": "CAM-KIT-01",
          "mpn": "MFR-KIT-01",
          "url": "https://www.bhphotovideo.com/c/product/example-kit.html",
          "price": 999.99
        }
      ]
    }
  ],
  "alternateOffers": [
    {
      "type": "used",
      "name": "Illustrative Camera",
      "productId": "803468261",
      "sku": "USED-01",
      "mpn": "MFR-KIT-01",
      "url": "https://www.bhphotovideo.com/c/used/123456/example-camera.html",
      "price": 599.99,
      "conditionCode": "8",
      "conditionDescription": "Well used"
    }
  ],
  "rebates": [
    {
      "description": "Illustrative cashback campaign",
      "type": "FREE",
      "url": "https://alphauniverse.com/example-campaign/",
      "expiresAt": "2027-01-01T04:59:59.000Z",
      "isRedeemableOnline": true,
      "amount": null
    }
  ],
  "warranty": {
    "manufacturer": {
      "description": "Limited 1-Year Warranty",
      "duration": 1,
      "period": "Year",
      "provider": "Manufacturer"
    },
    "plans": [
      {
        "name": "Protect Plus",
        "description": "2-Year Protect Plus",
        "productId": "1622862",
        "sku": "PLAN-01",
        "price": 132.99,
        "duration": 2,
        "period": "Year",
        "deductibleAmount": 0,
        "sellingPoints": [
          "Accidental damage protection"
        ],
        "url": "https://www.bhphotovideo.com/c/promotion/example.html"
      }
    ],
    "notes": [
      "During the manufacturer warranty this plan covers accidental damage."
    ]
  }
}
```

| Field | Type | Required? | Meaning |
| --- | --- | --- | --- |
| `name` | String | Yes | Product name. |
| `sku` | String | Optional | SKU or model number, when available. |
| `brand` | String | Optional | Product brand, when available. |
| `description` | String | Optional | Complete product introduction text. Detailed overview sections are preserved separately without length truncation. |
| `url` | URL string | Yes | B\&H Photo product page. |
| `price` | Number | Optional | Product price; values are zero or greater. |
| `currency` | String | Optional | Currency code associated with the price. |
| `availability` | String | Optional | Availability value published with the product data. |
| `ratingValue` | Number | Optional | Published product rating from 0 to 5. An unrated product’s placeholder zero is omitted. |
| `reviewCount` | Integer | Optional | Published review count, including an explicit source count of zero. |
| `productId` | String | Optional | Native B\&H numeric catalog ID, preserved as text. |
| `mpn` | String | Optional | Manufacturer part number, distinct from the B\&H SKU. |
| `gtin12` | String | Optional | Published 12-digit UPC, including leading zeros. |
| `brandDetails` | Object | Optional | Brand catalog and logo links, plus B\&H’s source-provided authorized-dealer designation. |
| `keyFeatures` | Array of strings | Optional | All published selling points, including those beyond the page preview. |
| `overview` | Array of objects | Optional | All product feature groups, complete sections, source text, safe HTML and associated media. |
| `specifications` | Array of objects | Optional | All specification groups and rows, retaining units, multi-line values and repeated labels in their original groups. |
| `imageGroups` | Array of objects | Optional | All published gallery groups and distinct images, each at its largest available source size. |
| `videos` | Array of objects | Optional | Product-related videos with titles, links, source media types and positive durations when published. |
| `includedItems` | Array of objects | Optional | All box contents, quantities, real product links and nested included items when supplied. Warranty entries remain part of this list. |
| `resources` | Array of objects | Optional | Product manuals and literature links with published file sizes. Files are not downloaded. |
| `categoryPath` | Array of objects | Optional | Product’s primary category hierarchy, with source category IDs, names and business links. |
| `offer` | Object | Optional | Condition, source offer expiry, displayed original price and published monetary discounts. Current price and currency stay in their existing fields. |
| `firmwareUpdates` | Array of objects | Optional | Product firmware notices, manufacturer links, versions, complete release descriptions and source publication dates. |
| `compatibleModels` | Array of objects | Optional | All source-listed compatible models, grouped by category. |
| `cannotShipTo` | Array of strings | Optional | Published destination restrictions kept as original labels, without inferred geography. |
| `configurations` | Array of objects | Optional | All published configuration groups and linked variant choices with their own IDs, SKU/part numbers, URLs and displayed prices. |
| `alternateOffers` | Array of objects | Optional | Published alternate buying options such as used items, preserving their own identities, prices and condition grades. |
| `rebates` | Array of objects | Optional | Published campaign descriptions, types, redemption links, expiration dates and rebate values when specified. |
| `warranty` | Object | Optional | Manufacturer warranty terms, all optional protection-plan offers, and source warranty cautions. No coverage is purchased or activated. |

At least one of `sku`, `brand`, `description`, `price`, `availability`, `ratingValue`, or `reviewCount` must also be present. Optional fields use values published on the matched product page. Unavailable values and empty collections are left out; no placeholder values or missing numbers are converted to zero. The source’s explicit `offer.priceValidUntil: null` and `rebates[].amount: null` are preserved. Explicit zero deductibles are real business values. A missing video duration, or a source duration of zero used for an unknown length, is omitted. An unavailable optional field alone does not make the run partial, but a failed detail-page request does when real records were saved. No search-page URL, scrape timestamp, diagnostic message, or run metadata is added to product records.

#### Nested product details

Every nested field below is optional unless marked required. Groups and arrays retain source order and all available entries within the pages read. There is no separate specifications, image or compatibility cap; `maxItems` limits products and additional detail requests, while `maxResponseBytes` limits each page response.

| Field | Type | Required? | Meaning |
| --- | --- | --- | --- |
| `brandDetails.url`, `brandDetails.logoUrl` | URL strings | Optional | Published brand catalog and logo links. |
| `brandDetails.isAuthorizedDealer` | Boolean | Optional | Source designation; an explicit `false` remains false. |
| `overview[].title` | String | Optional | Source group heading; unnamed groups have no invented heading. |
| `overview[].sections` | Array of objects | Required in group | Complete sections for this product. |
| `overview[].sections[].title`, `.note` | Strings | Optional | Source section heading and note. |
| `overview[].sections[].text`, `.html` | Strings | Optional | Complete section text and source HTML with executable elements and attributes removed. Paragraph/list boundaries are retained in text. |
| `overview[].sections[].media` | Array of objects | Optional | Images or videos associated with that section, with `url` (required), `name`, source `type` and positive `durationSeconds` when known. |
| `specifications[].name`, `.isKeySpec` | String, boolean | Optional | Source group label and key-spec designation. |
| `specifications[].specs` | Array of objects | Required in group | Specification rows with `name` and `value` (required), plus optional `note`. Values are strings or ordered arrays of source text lines, including original units and qualifiers. |
| `imageGroups[].name`, `.items` | String, array | Optional name; required items | Source gallery association and all distinct images. Each item has `url` (required), and optional published `width`, `height` in pixels and `caption`. |
| `videos[].url`, `.name`, `.type`, `.durationSeconds` | URL string, strings, number | Required URL; others optional | Published media link, title, source type such as YOUTUBE/VIMEO and duration in seconds. |
| `includedItems[].name` | String | Required in item | Box-content name, including warranty entries when provided. |
| `includedItems[].quantity`, `.productId`, `.url`, `.note`, `.includedItems` | Number, strings, array | Optional | Source quantity, linked item’s native ID and actual URL, source note, and recursively nested box contents in the same shape. Missing links are never replaced with the main product URL. |
| `resources[].url`, `.title`, `.sizeBytes` | URL string, string, integer | Required URL; others optional | Published literature link, title and file size in bytes. |
| `categoryPath[].name`, `.id`, `.url` | Strings | Required name; others optional | Source category name, native ID and link. |
| `offer.itemCondition`, `.priceValidUntil` | String, date string or null | Optional | Source condition and expiry date (`YYYY-MM-DD`) or explicit source null. |
| `offer.originalPrice`, `.savings` | Number, array | Optional | Displayed strikethrough price and monetary discounts. Each saving has source `type` and `amount` (both required); amounts use the product currency. |
| `firmwareUpdates[].url`, `.title`, `.date`, `.version`, `.description` | Strings | Required URL; others optional | Manufacturer link and full notice. The date is the published Unix-millisecond timestamp converted to UTC ISO 8601, not a scrape timestamp. |
| `compatibleModels[].categoryName`, `.models` | String, array of strings | Optional name; required models | Source compatibility category and every listed model. |
| `configurations[].name`, `.options` | String, array | Optional name; required options | Source configuration groups and all choices. Each option has `name` (required), and optional `productId`, `sku`, `mpn`, actual `url` and displayed `price`. |
| `alternateOffers[].type`, `.name`, `.productId`, `.sku`, `.mpn`, `.url`, `.price`, `.conditionCode`, `.conditionDescription` | Strings, number | Required type; others optional | Each alternate item’s own identity, price and published condition. These values never replace the main product’s price or identity. |
| `rebates[].description`, `.type`, `.url`, `.expiresAt`, `.isRedeemableOnline`, `.amount` | Strings, boolean, number or null | Required description; others optional | Full campaign text, source type, redemption link, source Unix-millisecond expiry converted to UTC ISO 8601, online-redemption designation and published value. An explicit source null stays null; amounts are never guessed from campaign text. |
| `warranty.manufacturer.description`, `.duration`, `.period`, `.provider` | Strings, number | Optional | Published manufacturer warranty description, duration, original period unit and coverage provider. |
| `warranty.plans` | Array of objects | Optional | Every published plan, with `name` (required), optional `description`, native `productId`, `sku`, `price`, `duration`, source `period`, `deductibleAmount`, all `sellingPoints` and a real information `url`. Source zero deductibles remain zero. |
| `warranty.notes` | Array of strings | Optional | Published warranty cautions and overlapping-coverage notes. |

The Actor matches native product identity before attaching specifications, overview sections and literature. It reads the product page’s embedded product data and structured product data; it does not copy entire website responses, unrelated recommendations, site navigation or customer-service contacts. If embedded product details are unavailable, supported structured product fields can still be returned. Compatibility, firmware notices, discounts and media vary by product. Configuration choices and alternate offers are linked as associated items; their detail pages are not separately crawled. Variant, alternate-offer and protection-plan prices use the parent product currency. Source warranty period units and destination labels are preserved rather than inferred. Manuals and manufacturer/media links are returned as business links; their contents are not independently downloaded or verified.

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Run status

The Actor counts a product only after its dataset write succeeds. A run with at least one saved product is **SUCCEEDED**. If a supplied page, product detail lookup, or storage write fails, saved products are kept and the run remains **SUCCEEDED** with `isPartial: true`. A run with no saved product records is **FAILED**, including an empty page or a page that returns only unusable data. Reaching `maxItems` is not a failure.

### Output summary

The **Output summary** link opens the `OUTPUT_SUMMARY` record in the run's default **Key-value store**. It contains exactly three fields:

| Field | Type | Required? | Meaning |
| --- | --- | --- | --- |
| `status` | String | Yes | `SUCCEEDED` when one or more product records were saved; otherwise `FAILED`. |
| `itemsStored` | Nonnegative integer | Yes | Number of product records whose dataset writes completed. |
| `isPartial` | Boolean | Yes | `true` when part of collection or a write failed after at least one product was saved. |

Example of a completed run:

```json
{
  "status": "SUCCEEDED",
  "itemsStored": 5,
  "isPartial": false
}
```

Example of a run with limited results:

```json
{
  "status": "SUCCEEDED",
  "itemsStored": 3,
  "isPartial": true
}
```

Example of a run with no saved product records:

```json
{
  "status": "FAILED",
  "itemsStored": 0,
  "isPartial": false
}
```

### Tips and access limitations

- Start with a page that visibly lists or describes products. A page without usable product data or accessible product links can produce no records.
- Only the listing pages you supply are visited. To collect the next page, add its URL to the input; automatic pagination is not supported.
- Some information is loaded only through additional site interactions. Individual review text, customer Q\&A, additional interactive variant-page details and third-party product explorers are not collected by this Actor.
- Public pages can change or restrict automated requests. This Actor reports those failures in the run log and does not attempt to bypass access controls.
- Keep `maxItems` modest when you only need a sample. Longer runs use more compute time.
- Use results in line with B\&H Photo's terms and applicable privacy and data-protection rules.

### Cost

Run cost depends on the applicable Apify plan and the compute time used. Category and search runs also read product detail pages, so they can take longer than a single product lookup. Check the current pricing information in your Apify account; no fixed price is set in this README.

### Support

For help with an Actor run, include the run ID and describe the input fields you used. Use the Actor's **Issues** tab for feedback, or the **API** tab for programmatic access.

# Actor input Schema

## `startUrls` (type: `array`):

Main URL field. Supply public B\&H Photo category, search, or product pages. Up to 50 URLs are accepted across all URL fields.

## `url` (type: `string`):

Compatibility alias for one B\&H Photo URL. Prefer startUrls for new inputs.

## `urls` (type: `array`):

Compatibility alias for a list of B\&H Photo URLs. Prefer startUrls for new inputs.

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

Maximum number of unique product records saved across all supplied pages.

## `timeoutSecs` (type: `integer`):

Maximum time to wait for each page request.

## `maxRetries` (type: `integer`):

Retries for temporary request failures and server errors. Access-control responses are not retried.

## `maxResponseBytes` (type: `integer`):

Stop reading an HTML page if its response exceeds this size.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.bhphotovideo.com/"
  ],
  "maxItems": 10,
  "timeoutSecs": 30,
  "maxRetries": 2,
  "maxResponseBytes": 5000000
}
```

# Actor output Schema

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

Dataset containing saved B\&H Photo product details.

## `runSummary` (type: `string`):

Summary record in the default key-value store.

# 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 = {
    "startUrls": [
        "https://www.bhphotovideo.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("codingfrontend/b-h-photo-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 = { "startUrls": ["https://www.bhphotovideo.com/"] }

# Run the Actor and wait for it to finish
run = client.actor("codingfrontend/b-h-photo-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 '{
  "startUrls": [
    "https://www.bhphotovideo.com/"
  ]
}' |
apify call codingfrontend/b-h-photo-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codingfrontend/b-h-photo-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/gyL6Eq97gysU6RbUH/builds/IOtA4W83wZm12U71t/openapi.json
