# 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# 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, engagement, publisher, date, search-context, and provenance fields. Important fields include `id`, `bingVideoId`, `videoId`, `title`, `link`, `position`, `queryPosition`, `globalPosition`, `durationSeconds`, `viewCount`, `publishedAt`, `searchQuery`, `dataSource`, `extractionMethod`, and `scrapedAt`.

The dataset preserves backward-compatible aliases such as `url`, `hostPageUrl`, and `hostPageDomain`.

### 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.

# 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.

## `debug` (type: `boolean`):

Enable verbose diagnostics without logging credentials or response bodies.

## 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
  },
  "debug": 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/m5p3vbyCGcW7c6dac/openapi.json
