# Dydx Markets Scraper (`zerobreak/dydx-markets-scraper`) Actor

This Actor collects live perpetual futures market snapshots and contract metadata from the decentralized exchange dYdX based on ticker symbols or market status. It extracts oracle prices, 24-hour trading volumes, open interest, funding rates, margin requirements, and market statuses

- **URL**: https://apify.com/zerobreak/dydx-markets-scraper.md
- **Developed by:** [ZeroBreak](https://apify.com/zerobreak) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 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/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

### dYdX Markets Scraper — Collect Perpetual Market Data and Trading Statistics

![dYdX Markets Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/dydx-markets-scraper-cover.png)

Collect dYdX v4 perpetual market information, including tickers, prices, trading volume, funding rates, open interest, and margin parameters. Filter by ticker, control the number of records, and export structured data as JSON, CSV, or Excel.

### What It Does

This actor collects dYdX v4 perpetual market records and converts them into structured dataset rows.

It removes duplicate markets using the CLOB pair identifier, falling back to the ticker when necessary. You can leave the `tickers` list empty to collect the full market list or provide specific tickers to filter the results.

### Available Mode

- **List Markets:** Collects dYdX v4 perpetual market information, including market status, pricing, volume, funding, and open interest.

### Input Example

```json
{
  "mode": "list",
  "tickers": [],
  "maxItems": 100,
  "requestDelayMs": 1000
}
```

### Input Parameters

| Parameter | Description | Example |
|---|---|---|
| `mode` | Selects the market collection mode. | `list` |
| `tickers` | Optional list of market tickers to collect. Leave empty for all available markets. | `["BTC-USD", "ETH-USD"]` |
| `maxItems` | Maximum number of market records to collect. | `100` |
| `requestDelayMs` | Delay between requests, in milliseconds. | `1000` |

### Output Example

```json
{
  "clobPairId": "0",
  "ticker": "BTC-USD",
  "status": "ACTIVE",
  "oraclePrice": "80488.76236",
  "priceChange24H": "119.01236",
  "volume24H": "1404427.7474",
  "trades24H": 990,
  "nextFundingRate": "0",
  "initialMarginFraction": "0.02",
  "maintenanceMarginFraction": "0.012",
  "openInterest": "210.1637",
  "atomicResolution": -10,
  "quantumConversionExponent": -9,
  "tickSize": "1",
  "stepSize": "0.0001",
  "stepBaseQuantums": 1000000,
  "subticksPerTick": 100000,
  "marketType": "CROSS",
  "openInterestLowerCap": "0",
  "openInterestUpperCap": "0",
  "scrapedAt": "2026-10-26T00:00:00+00:00"
}
```

### Output Fields

| Field | Description |
|---|---|
| `clobPairId` | Unique order book pair identifier. |
| `ticker` | Market ticker, such as `BTC-USD`. |
| `status` | Current market status. |
| `oraclePrice` | Market oracle price. |
| `priceChange24H` | Price change over the last 24 hours. |
| `volume24H` | Trading volume over the last 24 hours. |
| `trades24H` | Number of trades over the last 24 hours. |
| `nextFundingRate` | Next funding rate for the market. |
| `initialMarginFraction` | Initial margin requirement fraction. |
| `maintenanceMarginFraction` | Maintenance margin requirement fraction. |
| `openInterest` | Current market open interest. |
| `atomicResolution` | Atomic resolution parameter. |
| `quantumConversionExponent` | Quantum conversion exponent. |
| `tickSize` | Minimum price increment. |
| `stepSize` | Minimum order size increment. |
| `stepBaseQuantums` | Step base quantums parameter. |
| `subticksPerTick` | Subticks per tick parameter. |
| `marketType` | Market type, such as `CROSS`. |
| `openInterestLowerCap` | Lower open-interest cap. |
| `openInterestUpperCap` | Upper open-interest cap. |
| `scrapedAt` | Date and time when the record was collected. |

### Use Cases

- **Market Research:** Analyze perpetual markets using price, volume, and funding information.
- **Market Monitoring:** Track market status and open-interest changes across collection runs.
- **Trading Dashboards:** Prepare structured market data for charts and reporting tools.
- **Historical Analysis:** Save periodic market snapshots for offline comparison.
- **Dataset Building:** Create filtered datasets for selected trading pairs.

### Export Formats

Export collected records in JSON, CSV, Excel, and other supported Apify dataset formats.

### FAQ

**Who is this actor for?**

Analysts, developers, and researchers who need structured dYdX v4 perpetual market information.

**Can I collect specific markets only?**

Yes. Provide market tickers in the `tickers` input. Leave the list empty to collect all available markets.

**What market information is included?**

Records include ticker, status, oracle price, 24-hour price change, volume, trades, funding rate, margin requirements, and open interest.

**Can I run it on a schedule?**

Yes. You can configure Apify schedules to refresh the dataset automatically.

**How many markets can it collect per run?**

The actor supports up to 1000 records per run. Use `maxItems` and the optional ticker filter to control the results.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. There is no single law that bans all forms of web scraping. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

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

What to fetch. List loads dYdX v4 perpetual markets from the public indexer.

## `tickers` (type: `array`):

Optional ticker filter (for example BTC-USD). Leave empty to keep all markets, capped by maxItems.

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

Stop after this many successful rows. Hard max is 1000.

## `requestDelayMs` (type: `integer`):

Milliseconds to wait before each request. Raise if you see 429 responses.

## `userAgent` (type: `string`):

User-Agent header sent with each request.

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

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

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

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "mode": "list",
  "tickers": [],
  "maxItems": 100,
  "requestDelayMs": 1000,
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

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

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# 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 = {
    "tickers": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("zerobreak/dydx-markets-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 = { "tickers": [] }

# Run the Actor and wait for it to finish
run = client.actor("zerobreak/dydx-markets-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 '{
  "tickers": []
}' |
apify call zerobreak/dydx-markets-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zerobreak/dydx-markets-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/M1PbzpY3l6dk7KSql/builds/N0niIK1pK8Rpl4wxE/openapi.json
