# Crypto Arbitrage Scanner (spreads across 9 exchanges) (`rawtojson/crypto-arbitrage-scanner`) Actor

Compares spot prices of the same coin across Binance, KuCoin, OKX, Gate, MEXC, Bitget, HTX, Kraken and Crypto.com and lists where to buy low and sell high, net of fees.

- **URL**: https://apify.com/rawtojson/crypto-arbitrage-scanner.md
- **Developed by:** [Juan Francisco](https://apify.com/rawtojson) (community)
- **Categories:** Other
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Crypto Arbitrage Scanner

Compare the spot price of the same coin across **Binance, KuCoin, OKX, Gate, MEXC, Bitget, HTX, Kraken and Crypto.com** and get a ranked list of where to buy low and sell high, with the spread **net of taker fees**, the 24h volume on both sides and the top-of-book size when the exchange publishes it.

It only uses the public market-data endpoints of each exchange. No API keys, no login, no proxies.

### What you get

For every coin quoted on two or more exchanges, the best buy exchange (lowest ask) and best sell exchange (highest bid):

- `pair`, `buyExchange`, `buyPrice`, `sellExchange`, `sellPrice`
- `grossSpreadPct` and `netSpreadPct` (after the taker fees of both exchanges)
- `topOfBookTradableQuote` and `estProfitQuote` (size you can trade at the quoted prices, when both exchanges publish it)
- `volume24hBuyExchange`, `volume24hSellExchange`, `exchangesCompared`, `checkedAt`

### Input

| Field | Description |
|---|---|
| `exchanges` | Exchanges to compare (at least 2). Default: all 9. |
| `quoteAssets` | Quote assets to compare. Default `["USDT"]`. |
| `coins` | Optional list of coins (e.g. `["BTC","ETH"]`). Empty = every coin. |
| `minVolumeUsd` | Min 24h volume on both exchanges. Default 10,000. |
| `minNetSpreadPct` / `maxNetSpreadPct` | Net spread window. Default 0.1 to 20. |
| `feesPct` | Per-exchange taker fee overrides, e.g. `{"binance": 0.075}`. |
| `onlyNew` | Return only opportunities that were not in the previous run (schedule it). |
| `maxOpportunities` | Cap on results, best first. Default 100. |

### Pricing

Pay per event: **$0.003 per opportunity returned** plus a small start fee of $0.005 per run. You never pay for opportunities you filter out.

### Important notes

- This is **market data, not financial advice**. Real arbitrage also depends on withdrawal availability, transfer time, balances, slippage and latency. Prices are a snapshot of the order-book top.
- Very large spreads are usually different tokens sharing the same ticker, or suspended markets. Use the volume filter and the `maxNetSpreadPct` cap.
- Default fees are approximate base-tier taker fees. Override them with your own.
- Binance data comes from its public market-data mirror (`data-api.binance.vision`). Bybit and Coinbase are not included.
- If an exchange is temporarily unreachable it is skipped and the run continues with the others.

### Run it on a schedule

Combine it with a schedule and `onlyNew: true` to be notified (webhook, Slack, n8n, Make) only when a fresh opportunity appears.

# Actor input Schema

## `exchanges` (type: `array`):

Exchanges to compare (at least 2). Supported: binance, kucoin, gate, mexc, bitget, okx, htx, cryptocom, kraken.

## `quoteAssets` (type: `array`):

Only compare pairs quoted in these assets, e.g. USDT, USDC, USD, EUR, BTC.

## `coins` (type: `array`):

Base coin symbols to check, e.g. BTC, ETH. Leave empty to scan every coin.

## `minVolumeUsd` (type: `integer`):

Both exchanges must trade at least this much in the last 24h. Filters illiquid and fake spreads.

## `minNetSpreadPct` (type: `number`):

Minimum profit after taker fees, in percent.

## `maxNetSpreadPct` (type: `number`):

Discard spreads above this value: they are almost always different tokens sharing a ticker, or delisted markets.

## `feesPct` (type: `object`):

Optional per-exchange taker fee in percent, e.g. {"binance": 0.075}. Defaults are base-tier fees and approximate.

## `onlyNew` (type: `boolean`):

Return only opportunities that were not present in the previous run (use with a schedule).

## `maxOpportunities` (type: `integer`):

Maximum number of opportunities returned (best first).

## Actor input object example

```json
{
  "exchanges": [
    "binance",
    "kucoin",
    "okx",
    "gate",
    "mexc",
    "bitget",
    "htx",
    "cryptocom",
    "kraken"
  ],
  "quoteAssets": [
    "USDT"
  ],
  "minVolumeUsd": 10000,
  "minNetSpreadPct": 0.1,
  "maxNetSpreadPct": 20,
  "feesPct": {},
  "onlyNew": false,
  "maxOpportunities": 100
}
```

# Actor output Schema

## `opportunities` (type: `string`):

Best buy/sell exchange pairs by net spread.

# 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 = {
    "exchanges": [
        "binance",
        "kucoin",
        "okx",
        "gate",
        "mexc",
        "bitget",
        "htx",
        "cryptocom",
        "kraken"
    ],
    "quoteAssets": [
        "USDT"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rawtojson/crypto-arbitrage-scanner").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 = {
    "exchanges": [
        "binance",
        "kucoin",
        "okx",
        "gate",
        "mexc",
        "bitget",
        "htx",
        "cryptocom",
        "kraken",
    ],
    "quoteAssets": ["USDT"],
}

# Run the Actor and wait for it to finish
run = client.actor("rawtojson/crypto-arbitrage-scanner").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 '{
  "exchanges": [
    "binance",
    "kucoin",
    "okx",
    "gate",
    "mexc",
    "bitget",
    "htx",
    "cryptocom",
    "kraken"
  ],
  "quoteAssets": [
    "USDT"
  ]
}' |
apify call rawtojson/crypto-arbitrage-scanner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rawtojson/crypto-arbitrage-scanner"
        }
    }
}
```

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/laqZ8RgHr7Nd7Z8ur/builds/4ygeFXjayKudttSSV/openapi.json
