# Bloomberg Quote / Market Data Scraper (`xtracto/bloomberg-quote-scraper`) Actor

Scrape Bloomberg quote pages (stocks, indexes, bonds, funds, commodities, FX). Extracts header price, Summary stats, chart price-movements for selected timeframes, Related News, and Index/Profile Info. Uses TLS impersonation to bypass PerimeterX — no proxy or browser needed.

- **URL**: https://apify.com/xtracto/bloomberg-quote-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** News, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Bloomberg Quote / Market Data Scraper

Scrapes Bloomberg `/quote/{TICKER}` pages — stocks, indexes, bonds, funds, commodities, FX — without browser or login.

### ⚠️ Proxy Requirement

**Residential proxy is REQUIRED.** Bloomberg uses PerimeterX which reliably blocks Apify's datacenter IP ranges with an HTTP 403 *"Are you a robot?"* challenge. Without a residential proxy, every request will fail.

The actor input ships with a `proxyConfiguration` field pre-filled with `useApifyProxy: true, apifyProxyGroups: ["RESIDENTIAL"]` — leave it as-is, or plug in your own residential proxy provider. Apify Residential proxy is billed by GB of traffic — typical Bloomberg quote page ≈ 450 KB.

### What it extracts

Single HTML fetch of the quote page parses `__NEXT_DATA__` to produce:

- **Header**: name, ticker, security type/subtype, currency, exchange, price, change, % change, market status, last update
- **Summary tab**: day/52w range, volume, market cap, EPS, P/E, P/B, P/S, dividend, total returns
- **Chart**: price-movement time series for selectable timeframes (1D / 1M / 6M / YTD / 1Y / 5Y) — all six are embedded in the same page response, so picking fewer just trims output
- **Info block** (security-type aware):
  - `index` — description, source, members (when listed)
  - `company` — description, address, website, sector, executives (stocks/ETFs)
  - `bond` — security name, issuer, parent, maturity (bonds)
  - `fund` — fund type, manager, expense ratio, NAV, top holdings (funds/ETFs)
- **Related News** — best-effort via Bloomberg's internal `/markets2/api/relatedNews/...` endpoint. Tab is lazy-loaded on the website, so the news API is sometimes PerimeterX-blocked; when that happens, the field is an empty array with `relatedNewsError` set.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `urls` | array of string | required | Quote URLs (e.g. `https://www.bloomberg.com/quote/INDU:IND`) |
| `timeframes` | enum array | all six | Subset of `1D`, `1M`, `6M`, `YTD`, `1Y`, `5Y` |
| `includeChart` | bool | `true` | Set `false` to omit `chart` block (smaller output) |
| `includeRelatedNews` | bool | `true` | Set `false` to skip the news API call |
| `includeIndexInfo` | bool | `true` | Set `false` to omit the info block |
| `proxyConfiguration` | object | `{ useApifyProxy: true, apifyProxyGroups: ["RESIDENTIAL"] }` | **Required.** Residential proxy — datacenter IPs are blocked by Bloomberg PerimeterX. |
| `maxRetries` | int | 3 | Per URL, rotates `safari2601` → `safari260` (fresh proxy session each retry) |
| `delayBetweenRequests` | int | 2000 ms | Increase if hitting PerimeterX 403 |

### Run locally

```powershell
cd apify-actors/bloomberg-quote-scraper
apify run --input '{"urls": ["https://www.bloomberg.com/quote/INDU:IND"]}'
````

### Deploy

```powershell
cd apify-actors/bloomberg-quote-scraper
apify push
```

# Actor input Schema

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

List of Bloomberg quote URLs (e.g. https://www.bloomberg.com/quote/INDU:IND).

## `timeframes` (type: `array`):

Which chart timeframes to include in the `chart` field. All timeframes are extracted from the single page request — selecting fewer just trims the output.

## `includeRelatedNews` (type: `boolean`):

Attempt to fetch the Related News tab via Bloomberg's internal API. May return empty if the news API endpoint is currently rate-limited.

## `includeIndexInfo` (type: `boolean`):

Include the Index Info / Company Profile / Bond Info / Fund Info block (description, source, members/executives, etc.).

## `includeChart` (type: `boolean`):

Include the `chart` block with price-movement time series. Disable to keep output small.

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

Bloomberg PerimeterX blocks Apify's datacenter IPs reliably. Residential proxy is REQUIRED for this actor to work in production. Without proxy you will see HTTP 403 'Are you a robot?' challenges.

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

Maximum retry attempts per URL (rotates safari2601 → safari260 impersonation, fresh proxy session on each retry).

## `delayBetweenRequests` (type: `integer`):

Delay between requests in milliseconds. Increase if you hit PerimeterX 403 challenges.

## Actor input object example

```json
{
  "urls": [
    "https://www.bloomberg.com/quote/INDU:IND",
    "https://www.bloomberg.com/quote/GTJPY2Y:GOV"
  ],
  "timeframes": [
    "1D",
    "1M",
    "6M",
    "YTD",
    "1Y",
    "5Y"
  ],
  "includeRelatedNews": true,
  "includeIndexInfo": true,
  "includeChart": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "maxRetries": 3,
  "delayBetweenRequests": 2000
}
```

# 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 = {
    "urls": [
        "https://www.bloomberg.com/quote/INDU:IND",
        "https://www.bloomberg.com/quote/GTJPY2Y:GOV"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/bloomberg-quote-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 = {
    "urls": [
        "https://www.bloomberg.com/quote/INDU:IND",
        "https://www.bloomberg.com/quote/GTJPY2Y:GOV",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/bloomberg-quote-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "urls": [
    "https://www.bloomberg.com/quote/INDU:IND",
    "https://www.bloomberg.com/quote/GTJPY2Y:GOV"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call xtracto/bloomberg-quote-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=xtracto/bloomberg-quote-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Bloomberg Quote / Market Data Scraper",
        "description": "Scrape Bloomberg quote pages (stocks, indexes, bonds, funds, commodities, FX). Extracts header price, Summary stats, chart price-movements for selected timeframes, Related News, and Index/Profile Info. Uses TLS impersonation to bypass PerimeterX — no proxy or browser needed.",
        "version": "0.1",
        "x-build-id": "XMaegPn6Stk3OCaic"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/xtracto~bloomberg-quote-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-xtracto-bloomberg-quote-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/xtracto~bloomberg-quote-scraper/runs": {
            "post": {
                "operationId": "runs-sync-xtracto-bloomberg-quote-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/xtracto~bloomberg-quote-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-xtracto-bloomberg-quote-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "Quote URLs",
                        "type": "array",
                        "description": "List of Bloomberg quote URLs (e.g. https://www.bloomberg.com/quote/INDU:IND).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "timeframes": {
                        "title": "Chart Timeframes",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Which chart timeframes to include in the `chart` field. All timeframes are extracted from the single page request — selecting fewer just trims the output.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "1D",
                                "1M",
                                "6M",
                                "YTD",
                                "1Y",
                                "5Y"
                            ],
                            "enumTitles": [
                                "1 Day (intraday ticks)",
                                "1 Month",
                                "6 Months",
                                "Year-To-Date",
                                "1 Year",
                                "5 Years"
                            ]
                        },
                        "default": [
                            "1D",
                            "1M",
                            "6M",
                            "YTD",
                            "1Y",
                            "5Y"
                        ]
                    },
                    "includeRelatedNews": {
                        "title": "Include Related News",
                        "type": "boolean",
                        "description": "Attempt to fetch the Related News tab via Bloomberg's internal API. May return empty if the news API endpoint is currently rate-limited.",
                        "default": true
                    },
                    "includeIndexInfo": {
                        "title": "Include Index / Profile Info",
                        "type": "boolean",
                        "description": "Include the Index Info / Company Profile / Bond Info / Fund Info block (description, source, members/executives, etc.).",
                        "default": true
                    },
                    "includeChart": {
                        "title": "Include Chart Data",
                        "type": "boolean",
                        "description": "Include the `chart` block with price-movement time series. Disable to keep output small.",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Bloomberg PerimeterX blocks Apify's datacenter IPs reliably. Residential proxy is REQUIRED for this actor to work in production. Without proxy you will see HTTP 403 'Are you a robot?' challenges.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    },
                    "maxRetries": {
                        "title": "Max Retries Per URL",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Maximum retry attempts per URL (rotates safari2601 → safari260 impersonation, fresh proxy session on each retry).",
                        "default": 3
                    },
                    "delayBetweenRequests": {
                        "title": "Delay Between Requests (ms)",
                        "minimum": 500,
                        "maximum": 60000,
                        "type": "integer",
                        "description": "Delay between requests in milliseconds. Increase if you hit PerimeterX 403 challenges.",
                        "default": 2000
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
