# Bing Scraper (`dainty_screw/bing-scraper`) Actor

Harness the power of our Advanced Bing Scraper to extract accurate and up-to-date search results from Bing quickly. Ideal for market research, SEO analysis, and competitive intelligence. Supports global Bing domains.

- **URL**: https://apify.com/dainty_screw/bing-scraper.md
- **Developed by:** [codemaster devops](https://apify.com/dainty_screw) (community)
- **Categories:** Automation, Lead generation
- **Features:** Limited permissions
- **Stats:** 97 total users, 0 monthly users, 100.0% runs succeeded, 5 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.50 / 1,000 results

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

Learn more: https://docs.apify.com/actors/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 Search Scraper

Extract public Bing web search pages for SEO research, query monitoring and search workflows. This Actor requests static HTML; it does not log in, click ads, visit result websites, solve CAPTCHAs, or use a paid SERP provider.

### Quick start

Start with this bounded input (also maintained in `INPUT.json`). Omitted API input uses the same defaults. An explicitly empty `queries` array is an error.

```json
{
  "queries": [
    "Apify web scraping"
  ],
  "resultsPerPage": 10,
  "maxPagesPerQuery": 1,
  "marketCode": "en-US",
  "languageCode": "en",
  "csvFriendliness": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 2,
  "maxRequestsPerCrawl": 20,
  "maxResults": 100
}
```

Automatic Apify Proxy is preserved as the default. Set explicit `apifyProxyGroups`, `apifyProxyCountry`, or `proxyUrls` inside `proxyConfiguration` when needed. The legacy `proxyConfig` API alias remains supported; `proxyConfiguration` takes precedence. There is no silent direct fallback. Proxy availability and Bing responses depend on your plan, pool and geography; automatic proxy does not guarantee useful results. To intentionally connect directly, explicitly pass `{"useApifyProxy": false}`.

### Input and limits

| Field | Default | Meaning |
| --- | --- | --- |
| queries | \["Apify web scraping"] | 1–100 phrases or HTTPS `www.bing.com/search?q=...` URLs; duplicates removed |
| resultsPerPage | 10 | Requested Bing count, 1–100; actual result count can differ |
| maxPagesPerQuery | 1 | 1–100 pages, following visible next links only |
| maxRequestsPerCrawl | 20 | Global logical page budget, 1–1000; one bounded retry per page |
| maxResults | 100 | Global organic result limit, 1–10000; optional sections excluded |
| marketCode / languageCode | en-US / en | Values in the input form; sent to Bing, not guaranteed geographic filtering |
| csvFriendliness | false | false: one row per SERP page; true: one row per organic result |
| maxConcurrency | 2 | 1–100 concurrent requests; output writes serialized for a strict organic result limit |
| proxyConfiguration | useApifyProxy: true | Automatic/custom/explicit direct settings |

Explicit market/language/count input replaces these parameters on supplied URLs; other query parameters (such as `filters`) are retained. Only the fixed HTTPS Bing search host is fetched; redirects are rejected. Result links are extracted and optionally decoded offline, never visited. This is not a general URL crawler. Returned snippets and URLs are untrusted source data.

Pagination follows Bing's actual next control, validates increasing `first` offsets and detects repeated organic pages. A conservative query-token check rejects complete title/snippet/link mismatch even if Bing echoes the original query; it does not prove semantic relevance and may reject synonym-only results. Bing can ignore offsets, truncate results, show a challenge, return off-topic content or change its markup. `maxPagesPerQuery` is a ceiling, not a promise of that many useful pages. Estimated `count` is source text and is not an accurate available-record count. No date-filter UI, guaranteed rank tracking, ads extraction, standalone image/video/news search, enrichment, mailbox verification, browser rendering or complete PAA coverage is promised.

Work budget counts logical pages; retries and internal session/proxy operations can add network traffic. Concurrent requests may already be in flight at a limit. Use the platform timeout and memory limits in addition to these controls.

### Output

Default page mode preserves the existing field names:

```json
{
  "url": "https://www.bing.com/search?q=Apify+web+scraping&setmkt=en-US&setlang=en&count=10&first=1",
  "keyword": "Apify web scraping",
  "pageNumber": "1",
  "first": 1,
  "pages": [
    {"title": "Apify", "link": "https://apify.com/", "desc": "Web scraping platform"}
  ],
  "topBorders": [], "news": [], "images": [], "videos": []
}
```

This is an illustrative shape, not a guaranteed current SERP. `pages` contains organic results with `title`, `link`, `desc` and sometimes `date`. `pageNumber` remains a string for compatibility; `first` is the requested numeric offset. `count`, when present, is a string or zero. CSV mode emits those organic fields alongside `url`, `keyword`, `pageNumber`, `first` and optional `count`, without nested page arrays.

Legacy optional parsers retain `topBorders`, `news`, `images`, `videos`, `related`, `questions`, `explore` and `resultsFor` when recognized in returned static HTML. These sections are best effort and are not verified complete or equivalent to standalone vertical search. Empty arrays do not prove the section does not exist in the browser. Ads are not extracted.

`RUN_SUMMARY` in the default key-value store records status, proxy mode/group/country without credentials, attempts/retries, pages saved, organic count, dataset row count, explicit empty pages, failures and stop reasons. An explicit no-results marker is a valid empty page; unknown markup/challenges and exhausted requests fail the run with partial data preserved. In CSV mode a valid empty page writes no dataset row. Error records are kept out of the result dataset.

Export the default dataset as JSON, CSV, XLSX or another supported [Apify export format](https://docs.apify.com/api/v2/dataset-items-get). The Actor output schema links to the dataset and summary. This is a batch Actor; no web server/Standby endpoint exists.

### API example

Use `INPUT.json` as the request body. Keep tokens in the Authorization header, never in committed input or public URLs:

```bash
curl --request POST \
  --header "Authorization: Bearer $APIFY_TOKEN" \
  --header "Content-Type: application/json" \
  --data-binary @INPUT.json \
  "https://api.apify.com/v2/acts/dainty_screw~advanced-bing-scraper/runs?timeout=180&memory=512&maxTotalChargeUsd=0.10"
```

This production API example uses the revised input only after the owner deploys the feature version. During audit, use the private test Actor ID in `audit/STATUS.md`. Poll `GET /v2/actor-runs/{runId}` and fetch `GET /v2/datasets/{defaultDatasetId}/items` and `GET /v2/key-value-stores/{defaultKeyValueStoreId}/records/RUN_SUMMARY`. See the [official API](https://docs.apify.com/api/v2/acts-runs-post).

### Costs, cancellation and storage

Production pricing is controlled in Apify and is unchanged by this branch. The inspected production model bills default dataset items: page mode writes one item per parsed page, CSV mode one item per organic result. Changing modes changes the billable unit; do not assume a page is one organic result. Startup, compute, storage and proxy traffic may also apply. A pay-per-event charge cap is not an all-in compute/proxy budget. Use a small sample first.

Graceful platform abort (`POST /v2/actor-runs/{runId}/abort?gracefully=true`) persists an aborted summary and tears down active work. Hard kills cannot guarantee a final summary. This version intentionally uses fresh storage: do not resurrect old SDK2 queues/runs. A dataset write and its in-memory completion marker are not transactional; an interrupted acknowledged write can be duplicated. Deduplicate page mode by `url` and flat mode by `(url, link)` on the consumer side. No automatic migration or exactly-once guarantee is claimed.

### Development

Use Node 22 or 24. Run `npm ci`, `npm test`, `npm run lint`, `npm run validate`, `apify validate-schema`, and `npm audit --audit-level=high`. Run the real entry point using `apify run --input-file INPUT.json`; set `APIFY_LOCAL_STORAGE_DIR` to isolated storage for evidence. CLI authentication supplies proxy credentials; tests with explicit direct input do not verify Apify Proxy. CI verifies clean Linux installation on both supported Node versions without deployment.

See `audit/STATUS.md` for actual cloud evidence, limitations, production rebuild/input-reset steps and pending Store actions. A build does not replace saved Actor/task input.

### Support and responsible use

Contact <codemasterdevops@gmail.com>. Public availability does not itself establish permission to scrape or reuse data. Follow applicable terms and requirements for your use case.

# Actor input Schema

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

Bing Search queries (e.g. food in NYC) and/or full URLs (e.g. https://www.bing.com/search?q=food+NYC). Enter one item per field.

## `resultsPerPage` (type: `integer`):

Requested Bing count (1–100), not a guarantee. Actual page size varies; pagination follows Bing next links.

## `maxPagesPerQuery` (type: `integer`):

The maximum number of search result pages crawled for each search query or URL. Note that a value greater than one might significantly slow down the actor.

## `marketCode` (type: `string`):

Bing Search returns content for set market.

## `languageCode` (type: `string`):

Language for the search results.

## `csvFriendliness` (type: `boolean`):

Remove results that are not CSV friendly.

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

Automatic Apify Proxy by default. Explicit groups, country and custom proxies are preserved. Legacy API alias proxyConfig is accepted. No automatic direct fallback.

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

The maximum number of search results pages the crawler will load in parallel. A higher number means you will get your results faster, but also it will burn through your available proxies quicker.

## `maxRequestsPerCrawl` (type: `integer`):

Maximum logical page attempts across all queries. Each can retry once; HTTP redirects and session work may add network requests.

## `maxResults` (type: `integer`):

Maximum organic results saved across all queries; excludes optional SERP sections. Page mode writes one row per page; CSV mode one row per organic result.

## Actor input object example

```json
{
  "queries": [
    "Apify web scraping"
  ],
  "resultsPerPage": 10,
  "maxPagesPerQuery": 1,
  "marketCode": "en-US",
  "languageCode": "en",
  "csvFriendliness": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 2,
  "maxRequestsPerCrawl": 20,
  "maxResults": 100
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (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 = {
    "queries": [
        "Apify web scraping"
    ],
    "resultsPerPage": 10,
    "maxPagesPerQuery": 1,
    "marketCode": "en-US",
    "languageCode": "en",
    "proxyConfiguration": {
        "useApifyProxy": true
    },
    "maxConcurrency": 2,
    "maxRequestsPerCrawl": 20,
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("dainty_screw/bing-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 = {
    "queries": ["Apify web scraping"],
    "resultsPerPage": 10,
    "maxPagesPerQuery": 1,
    "marketCode": "en-US",
    "languageCode": "en",
    "proxyConfiguration": { "useApifyProxy": True },
    "maxConcurrency": 2,
    "maxRequestsPerCrawl": 20,
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("dainty_screw/bing-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 '{
  "queries": [
    "Apify web scraping"
  ],
  "resultsPerPage": 10,
  "maxPagesPerQuery": 1,
  "marketCode": "en-US",
  "languageCode": "en",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 2,
  "maxRequestsPerCrawl": 20,
  "maxResults": 100
}' |
apify call dainty_screw/bing-scraper --silent --output-dataset

```

## MCP server setup

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