# Bing Videos Scraper (`searchapi/bing-videos-scraper`) Actor

Scrapes video results from Bing Videos search. Extracts title, direct play URL, channel, duration, view count, publication date, thumbnail, and rich metadata.

- **URL**: https://apify.com/searchapi/bing-videos-scraper.md
- **Developed by:** [Search API](https://apify.com/searchapi) (community)
- **Categories:** Videos, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 search 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

## Bing Videos Scraper

Collect rich public listing data from Bing Videos. The Actor enters one or more keyword searches, reads the source-backed metadata exposed by Bing's result cards, applies optional filters/sorting, and stores clean records without null or empty placeholders.

### Modes

- `search`: use `query`, `queries`, or both. Each unique query gets a fair per-query allowance and the final dataset is interleaved.
- `url`: process one or more public Bing Videos search URLs.
- Set `maxItems: 1` when only the first matching video is needed.

### Useful inputs

| Input | Purpose |
|---|---|
| `query`, `queries` | One primary and up to 19 additional searches |
| `market`, `safeSearch` | Bing market and public safety setting |
| `maxItems`, `maxItemsPerQuery` | Global and per-query limits |
| `sortBy` | Relevance, most viewed, newest, shortest, or longest |
| `platforms` | Optional platform allowlist such as YouTube |
| `minDurationSeconds`, `maxDurationSeconds` | Duration filters |
| `minViewCount` | Minimum source-backed view count |
| `includeShorts`, `includeLive` | Include or exclude those result types |
| `maxConcurrency`, `maxScrolls` | Bounded performance controls |
| `proxyConfiguration` | Direct, authorized Apify Proxy, or custom proxy configuration |

Filters and non-relevance sorts are applied to the real candidates collected from Bing. Records with unavailable optional attributes omit those keys instead of inventing values.

### Output

The stable output includes identity, ranking, media, view-count, publisher, date, search-context, and provenance fields. Important fields include `id`, `bingVideoId`, `videoId`, `title`, `link`, `position`, `globalPosition`, `durationSeconds`, `views`, `viewCount`, `searchQuery`, `dataSource`, `extractionMethod`, and `scrapedAt`.

Bing's relative date labels remain in `publishedAtRaw` and `relativeTime`; the Actor leaves `publishedAt` empty until Bing exposes an absolute date. Counts such as `1.2K views` are parsed into `viewCount` and marked with `viewCountIsApproximate`. `isShort` is set only when Bing's card or a visible Shorts section identifies the result as short-form. Optional fields are omitted when the inspected card does not expose them.

A real output record is kept at [`samples/sample-record.json`](samples/sample-record.json).

### Example

```json
{
  "query": "machine learning tutorial",
  "queries": ["robotics documentary"],
  "maxItems": 20,
  "maxItemsPerQuery": 10,
  "sortBy": "views_desc",
  "minDurationSeconds": 60,
  "platforms": ["YouTube"],
  "maxConcurrency": 2,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

### Reliability

The Actor validates HTTP status and HTML content type before extraction, detects explicit no-results and challenge pages, uses bounded retries and stable browser sessions/fingerprints, recursively removes empty values, and never stores challenge/error pages as video records. Direct access is the default; proxies are optional and must be authorized.

# Changelog

This Actor's version history is a separate document: https://apify.com/searchapi/bing-videos-scraper/changelog.md

# Actor input Schema

## `mode` (type: `string`):

Search by keywords or use exact public Bing Videos search URLs.

## `query` (type: `string`):

The primary keywords entered in Bing Videos. Use this field, queries, or both.

## `queries` (type: `array`):

Optional additional keyword searches. Results are capped per query and fairly interleaved.

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

Required only in URL mode. Only public https://www.bing.com/videos/search URLs are accepted.

## `market` (type: `string`):

Language-country market such as en-US or en-GB.

## `safeSearch` (type: `string`):

Bing's public video safety setting.

## `sortBy` (type: `string`):

Keep Bing relevance order or sort the source-backed candidates by a numeric/date field.

## `platforms` (type: `array`):

Optional case-insensitive platform allowlist, for example YouTube or Vimeo.

## `minDurationSeconds` (type: `integer`):

Keep videos with at least this many seconds when duration is available.

## `maxDurationSeconds` (type: `integer`):

Keep videos with no more than this many seconds when duration is available.

## `minViewCount` (type: `integer`):

Keep videos whose source-backed view count meets this minimum.

## `includeShorts` (type: `boolean`):

Keep results classified as short-form videos.

## `includeLive` (type: `boolean`):

Keep results classified as currently live videos.

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

Global maximum after fair interleaving.

## `maxItemsPerQuery` (type: `integer`):

Optional per-query cap. By default the global maximum is divided fairly.

## `maxScrolls` (type: `integer`):

Bounded lazy-loading rounds per query.

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

Maximum simultaneous query pages.

## `maxRequestRetries` (type: `integer`):

Bounded retries for temporary browser/network failures.

## `navigationTimeoutSecs` (type: `integer`):

Maximum seconds allowed for one browser navigation.

## `requestHandlerTimeoutSecs` (type: `integer`):

Maximum seconds allowed for extraction from one query page.

## `headless` (type: `boolean`):

Run Chromium without a visible window.

## `proxyConfiguration` (type: `object`):

Direct access is the default. Authorized Apify or custom proxies are supported when needed.

## Actor input object example

```json
{
  "mode": "search",
  "query": "machine learning tutorial",
  "market": "en-US",
  "safeSearch": "moderate",
  "sortBy": "relevance",
  "includeShorts": true,
  "includeLive": true,
  "maxItems": 50,
  "maxScrolls": 30,
  "maxConcurrency": 1,
  "maxRequestRetries": 3,
  "navigationTimeoutSecs": 90,
  "requestHandlerTimeoutSecs": 180,
  "headless": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "query": "machine learning tutorial",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("searchapi/bing-videos-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 = {
    "query": "machine learning tutorial",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("searchapi/bing-videos-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 '{
  "query": "machine learning tutorial",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call searchapi/bing-videos-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,searchapi/bing-videos-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/CtR0a85PzN7b7jYYM/builds/9HIXxzBvxlQFLPXiw/openapi.json
