# Phemex Crypto Tickers Scraper (`parseforge/phemex-tickers-scraper`) Actor

Scrape live spot and perpetual tickers from Phemex public API. Returns last price, 24h open/high/low/volume/turnover, price change percent for every product type. No API key required.

- **URL**: https://apify.com/parseforge/phemex-tickers-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

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

![ParseForge Banner](https://github.com/ParseForge/apify-assets/raw/main/banner.jpg)

## 📈 Phemex Crypto Tickers Scraper

> 🚀 **Export every Phemex spot and perpetual ticker in seconds.** Pull **700+ symbols** across spot, USDT-margined linear perps, and USD-margined inverse perps with last price, 24h open/high/low, volume, turnover, funding rate, open interest, and computed price-change percent. No API key, no signing, no manual scale conversions.

> 🕒 **Last updated:** 2026-05-13 · **📊 27 fields** per ticker · **🏛️ 700+ products** · **🪙 Spot + Linear Perps + Inverse Perps**

The **Phemex Crypto Tickers Scraper** queries Phemex's public market-data endpoints (`/exchange/public/cfg/v2/products` for the product catalog, `/md/v3/spot/ticker/24hr/all`, `/md/v3/ticker/24hr/all`, and `/md/ticker/24hr/all` for the three ticker streams). It joins the catalog with the right ticker for each product, applies Phemex's per-product price/value scaling, and emits one clean record per symbol with last price, 24h open/high/low, bid/ask, index/mark, volume, turnover, open interest, funding rate, predicted funding rate, computed 24h price change, percent change, absolute spread, and basis-point spread.

Three product types are filterable: **Spot** (e.g. `sBTCUSDT`), **Perpetual** (USD-margined inverse perps like `cBTCUSD`), and **PerpetualV2** (USDT-margined linear perps like `BTCUSDT`). A pilot listings type is also available. Quote-currency filter covers USDT, USD, USDC, BTC, ETH, TRY. Sort by USD turnover (default), 24h volume, percent change, last price, or symbol A to Z before applying maxItems. Download CSV, Excel, JSON, or XML.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Crypto traders, perpetuals desks, derivatives researchers, market makers, fintech apps, treasury teams, quant analysts | Spot/perps tickers, funding-rate scans, open-interest dashboards, 24h leaderboards, exchange-comparison feeds, basis tracking |

---

### 📋 What the Phemex Crypto Tickers Scraper does

Five filters in one run:

- 🪙 **Product type filter.** Spot, PerpetualV2 (USDT linear), Perpetual (USD inverse), or PerpetualPilot listings.
- 💵 **Quote currency filter.** USDT, USD, USDC, BTC, ETH, TRY.
- 🚦 **Status filter.** Listed, Delisted, or Suspended.
- 🔽 **Sort.** Turnover USD (default), 24h volume, 24h percent change, last price, or symbol.
- ✂️ **Slice.** maxItems applied after sort.

Each ticker record carries the symbol, display symbol, Phemex URL (spot or perp trade page), product type, status, base/quote/settle currencies, last price, 24h open/high/low, bid/ask (when available), index price and mark price (for perps), volume, turnover, open interest (perps), funding rate and predicted funding rate (perps), computed price-change-percent, absolute and basis-point spread, tick size, contract size, and the exchange timestamp.

> 💡 **Why it matters:** Phemex's three ticker streams use different scaling (price scale, value scale, ratio scale). Manually joining the product catalog with the right stream and converting scaled integers to decimals is fiddly. This Actor does all of that and ships ready-to-trade records.

---

### 🎬 Full Demo

_🚧 Coming soon: a 3-minute walkthrough showing how to pull the top 100 USDT-margined perps by turnover and pipe results into a dashboard._

---

### ⚙️ Input

<table>
<thead>
<tr><th>Input</th><th>Type</th><th>Default</th><th>Behavior</th></tr>
</thead>
<tbody>
<tr><td><code>productType</code></td><td>string (enum)</td><td><code>""</code></td><td>Spot, Perpetual (inverse), PerpetualV2 (USDT linear), or PerpetualPilot. Empty = all.</td></tr>
<tr><td><code>quoteCurrency</code></td><td>string (enum)</td><td><code>""</code></td><td>USDT, USD, USDC, BTC, ETH, TRY. Empty = all.</td></tr>
<tr><td><code>statusFilter</code></td><td>string (enum)</td><td><code>"Listed"</code></td><td>Listed, Delisted, or Suspended. Empty = all.</td></tr>
<tr><td><code>maxItems</code></td><td>integer</td><td><code>10</code></td><td>Records to return. Free plan caps at 10, paid plan at 1,000,000.</td></tr>
<tr><td><code>sortBy</code></td><td>string (enum)</td><td><code>"turnoverUsd"</code></td><td>Sort before slicing. Options: turnoverUsd, volume24h, priceChangePercent24h, lastPrice, symbol.</td></tr>
</tbody>
</table>

**Example: top 50 USDT-margined linear perps by 24h turnover.**

```json
{
    "productType": "PerpetualV2",
    "quoteCurrency": "USDT",
    "statusFilter": "Listed",
    "maxItems": 50,
    "sortBy": "turnoverUsd"
}
````

**Example: every spot pair, A to Z.**

```json
{
    "productType": "Spot",
    "statusFilter": "Listed",
    "maxItems": 1000,
    "sortBy": "symbol"
}
```

> ⚠️ **Good to Know:** the inverse perpetuals stream returns scaled integers and the spot stream uses Phemex's `Ep`/`Ev` (priceScale/valueScale) convention. The Actor applies the right scaling per product. You get plain decimals out.

***

### 📊 Output

Each ticker record contains up to **27 fields**. Download as CSV, Excel, JSON, or XML.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 🆔 `symbol` | string | `"cXRPUSD"` |
| 🏷️ `displaySymbol` | string | null | `"XRP / USD"` |
| 🔗 `url` | string | `"https://phemex.com/trade/cXRPUSD"` |
| 🪙 `type` | string | `"Perpetual"` |
| 🚦 `status` | string | `"Listed"` |
| 🪙 `base` | string | null | `"XRP"` |
| 💵 `quote` | string | null | `"USD"` |
| 🏦 `settleCurrency` | string (optional) | `"XRP"` |
| 💲 `lastPrice` | number | null | `1.4175` |
| ⏰ `open24h` | number | null | `1.4421` |
| 🔺 `high24h` | number | null | `1.4683` |
| 🔻 `low24h` | number | null | `1.408` |
| 📊 `bid` | number (optional) | `1.4170` |
| 📊 `ask` | number (optional) | `1.4180` |
| 📐 `indexPrice` | number | null | `1.4181` |
| 📐 `markPrice` | number (optional) | `1.4176` |
| 📊 `volume24h` | number | null | `18207582` |
| 💱 `turnover24h` | number | null | `126611913027.713` |
| 🪙 `openInterest` | number (optional) | `17481941` |
| 💸 `fundingRate` | number (optional) | `0.0001` |
| 💸 `predFundingRate` | number (optional) | `0.0001` |
| 📈 `priceChange24h` | number | null | `-0.0246` |
| 📈 `priceChangePercent24h` | number | null | `-1.7058` |
| 📏 `spreadAbs` | number (optional) | `0.0010` |
| 📏 `spreadBps` | number (optional) | `7.06` |
| 🔢 `tickSize` | number (optional) | `0.0001` |
| 📦 `contractSize` | number (optional) | `1` |
| 🕒 `timestamp` | ISO 8601 (optional) | `"2026-05-13T22:20:43.372Z"` |
| 🕒 `scrapedAt` | ISO 8601 | `"2026-05-13T22:20:44.409Z"` |

#### 📦 Sample records

<details>
<summary><strong>🪙 Inverse perpetual: XRP/USD (USD-margined)</strong></summary>

```json
{
    "symbol": "cXRPUSD",
    "displaySymbol": "XRP / USD",
    "url": "https://phemex.com/trade/cXRPUSD",
    "type": "Perpetual",
    "status": "Listed",
    "base": "XRP",
    "quote": "USD",
    "settleCurrency": "XRP",
    "lastPrice": 1.4175,
    "open24h": 1.4421,
    "high24h": 1.4683,
    "low24h": 1.408,
    "indexPrice": 1.4181,
    "markPrice": 1.4176,
    "volume24h": 18207582,
    "turnover24h": 126611913027.713,
    "openInterest": 17481941,
    "fundingRate": 0.0001,
    "predFundingRate": 0.0001,
    "priceChange24h": -0.0246,
    "priceChangePercent24h": -1.7058,
    "tickSize": 0.0001,
    "contractSize": 1,
    "timestamp": "2026-05-13T22:20:43.372Z",
    "scrapedAt": "2026-05-13T22:20:44.409Z"
}
```

</details>

<details>
<summary><strong>🐶 Linear perpetual V2 with bid/ask + spread: 1000SHIB/USDT</strong></summary>

```json
{
    "symbol": "u1000SHIBUSDT",
    "displaySymbol": "1000SHIB / USDT",
    "url": "https://phemex.com/trade/u1000SHIBUSDT",
    "type": "PerpetualV2",
    "status": "Listed",
    "base": "1000 SHIB",
    "quote": "USDT",
    "settleCurrency": "USDT",
    "lastPrice": 0.00625,
    "open24h": 0.006449,
    "high24h": 0.006559,
    "low24h": 0.006207,
    "bid": 0.006248,
    "ask": 0.00625,
    "indexPrice": 0.00626,
    "markPrice": 0.006256,
    "volume24h": 511526760,
    "turnover24h": 3261890.418044,
    "openInterest": 272972802.615,
    "fundingRate": -6.725e-05,
    "predFundingRate": -6.725e-05,
    "priceChange24h": -0.000199,
    "priceChangePercent24h": -3.0857,
    "spreadAbs": 2e-06,
    "spreadBps": 3.2,
    "tickSize": 1e-06,
    "timestamp": "2026-05-13T22:20:42.272Z",
    "scrapedAt": "2026-05-13T22:20:44.410Z"
}
```

</details>

<details>
<summary><strong>🟦 Inverse perpetual: ADA/USD</strong></summary>

```json
{
    "symbol": "cADAUSD",
    "displaySymbol": "ADA / USD",
    "url": "https://phemex.com/trade/cADAUSD",
    "type": "Perpetual",
    "status": "Listed",
    "base": "ADA",
    "quote": "USD",
    "settleCurrency": "ADA",
    "lastPrice": 0.2631,
    "open24h": 0.272,
    "high24h": 0.2772,
    "low24h": 0.2613,
    "indexPrice": 0.2635,
    "markPrice": 0.2633,
    "volume24h": 919309,
    "turnover24h": 34178048428.9848,
    "openInterest": 4334983,
    "fundingRate": 0.0001,
    "predFundingRate": 0.0001,
    "priceChange24h": -0.0089,
    "priceChangePercent24h": -3.2721,
    "tickSize": 0.0001,
    "contractSize": 1,
    "timestamp": "2026-05-13T22:20:43.372Z",
    "scrapedAt": "2026-05-13T22:20:44.409Z"
}
```

</details>

***

### ✨ Why choose this Actor

| | Capability |
|---|---|
| 🏛️ | **Three markets, one Actor.** Spot, USDT-margined linear perps, and USD-margined inverse perps. |
| 🔢 | **Scaled integers decoded.** Phemex's price/value/ratio scaling handled per-product, so you get clean decimals. |
| 💸 | **Funding + open interest.** Live funding rate and open interest for every perp record. |
| 📏 | **Computed spread.** Absolute and basis-point spread per symbol. |
| 🔽 | **Server-side sort.** Turnover USD, 24h volume, percent change, last price, or symbol. |
| ⚡ | **Fast.** 700+ symbols joined and decoded in seconds. |
| 🚫 | **No API key.** Works against the public Phemex market-data endpoints. |

> 📊 Funding rate, open interest, and basis-point spread are the leading signals for crypto derivatives desks. Clean per-symbol records are the foundation of every perps dashboard, basis-trade scanner, and risk model.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| **⭐ Phemex Tickers Scraper** *(this Actor)* | $5 free credit, then pay-per-use | **700+ symbols, 3 markets** | **Live per run** | type, quote, status, sort | ⚡ 2 min |
| Phemex web app | Free | Same | Live | Manual click-through | 🐢 Browser only |
| Phemex public API direct | Free | Same | Live | None - you write scaling code | 🛠️ Hours |
| Aggregator APIs | Free or paid | Cross-exchange | Often delayed | Varies | ⏳ Multi-step |

Pick this Actor when you want clean, normalized tickers across spot, linear perps, and inverse perps with one click.

***

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the Phemex Crypto Tickers Scraper on the Apify Store.
3. 🎯 **Set input.** Pick a product type and quote currency, set `maxItems`, and choose a sort key.
4. 🚀 **Run it.** Click **Start**.
5. 📥 **Download.** Grab CSV, Excel, JSON, or XML from the **Dataset** tab.

> ⏱️ Total time from signup to downloaded dataset: **3-5 minutes.** No coding required.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%" valign="top">

#### 💼 Trading & Quant

- 24h turnover leaderboards on linear perps
- Funding-rate scans for basis arbitrage
- Open-interest dashboards across symbols
- Spread-aware execution decisions

</td>
<td width="50%" valign="top">

#### 🏦 Treasury & Risk

- Mark-to-market pricing for derivative books
- Liquidity tiering by 24h turnover
- Monitor predicted funding for next epoch
- Verify product status before placing orders

</td>
</tr>
<tr>
<td width="50%" valign="top">

#### 📊 Market Data & Aggregators

- Daily product-catalog snapshots
- Cross-exchange perpetual comparison feeds
- Detect listings and delistings as they happen
- Power a multi-venue index basket

</td>
<td width="50%" valign="top">

#### 🚨 Apps, Alerts & Dashboards

- Slack/Discord bots on funding rate flips
- "Top movers" widgets per market type
- Onboarding flows with live bid/ask quotes
- Portfolio dashboards with index + mark

</td>
</tr>
</table>

***

### 🔌 Automating Phemex Tickers Scraper

Control the scraper programmatically for scheduled runs and pipeline integrations:

- 🟢 **Node.js.** Install the `apify-client` NPM package.
- 🐍 **Python.** Use the `apify-client` PyPI package.
- 📚 See the [Apify API documentation](https://docs.apify.com/api/v2) for full details.

The [Apify Schedules feature](https://docs.apify.com/platform/schedules) lets you trigger this Actor on any cron interval. Minute-level for live trading dashboards, hourly for analytics, daily for catalog snapshots.

***

### 🌟 Beyond business use cases

Derivatives data powers more than trading desks. The same records support research, education, and personal projects.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Empirical studies on funding rates and basis
- Cross-exchange perpetual liquidity analysis
- Reproducible event studies on listings
- Coursework on derivatives microstructure

</td>
<td width="50%">

#### 🎨 Personal and creative

- Side projects, indie trading apps
- Watchlists for personal perp positions
- Hackathon prototypes with live data
- Content for crypto analysts and YouTubers

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Community and education

- Transparency dashboards for community-watched perps
- Open scoreboards for funding-rate hawks
- Tutorial materials for derivatives traders
- Public watchlists for trading communities

</td>
<td width="50%">

#### 🧪 Experimentation

- Train ML models on funding/open-interest signals
- Backtest basis and carry strategies
- Prototype perps risk models
- Stress-test indexers against live data

</td>
</tr>
</table>

***

### 🤖 Ask an AI assistant about this scraper

Open a ready-to-send prompt about this ParseForge actor in the AI of your choice:

- 💬 [**ChatGPT**](https://chat.openai.com/?q=How%20do%20I%20use%20the%20Phemex%20Crypto%20Tickers%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🧠 [**Claude**](https://claude.ai/new?q=How%20do%20I%20use%20the%20Phemex%20Crypto%20Tickers%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🔍 [**Perplexity**](https://perplexity.ai/search?q=How%20do%20I%20use%20the%20Phemex%20Crypto%20Tickers%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🅒 [**Copilot**](https://copilot.microsoft.com/?q=How%20do%20I%20use%20the%20Phemex%20Crypto%20Tickers%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)

***

### ❓ Frequently Asked Questions

#### 🧩 How does it work?

The Actor pulls Phemex's product catalog plus three ticker streams (spot, USDT-linear perps, USD-inverse perps), joins each product to the right ticker, decodes Phemex's scaled-integer convention, and emits one record per symbol.

#### 🏛️ Which markets are covered?

Spot (e.g. `sBTCUSDT`), Perpetual (USD-margined inverse perps, e.g. `cBTCUSD`), PerpetualV2 (USDT-margined linear perps, e.g. `BTCUSDT`), and PerpetualPilot listings.

#### 🔢 Why do raw Phemex tickers look like huge integers?

Phemex serializes prices/values as integers scaled by powers of 10 (priceScale, valueScale, ratioScale). This Actor applies the per-product scaling to give you clean decimals.

#### 💸 Are funding rates in percent or decimal?

Decimal. `fundingRate: 0.0001` means 0.01%. `fundingRate: -6.725e-05` means -0.006725%.

#### 🚫 Do I need an API key?

No. The Actor uses Phemex's public market-data endpoints.

#### ⏰ Can I schedule regular runs?

Yes. Use Apify Schedules to run the Actor on any cron interval. Minute-by-minute for funding-rate trackers, hourly for analytics, daily for snapshots.

#### 🔁 How fresh is the data?

Every run hits live endpoints. There is no caching.

#### 📏 What's `spreadBps`?

The bid-ask spread in basis points: `(ask - bid) / lastPrice * 10000`. Useful for execution cost modeling.

#### 🔁 What happens if a run fails?

Apify retries transient errors automatically. If a run still fails, inspect the log, adjust input, and re-run. Partial datasets are preserved.

#### 💳 Do I need a paid Apify plan?

No. Free plan covers testing (10 records per run). Paid plans unlock up to 1,000,000 items and scheduling.

#### 🆘 What if I need help?

Our support team is here to help. Contact us through the Apify platform or use the Tally form linked below.

***

### 🔌 Integrate with any app

Phemex Tickers Scraper connects to any cloud service via [Apify integrations](https://apify.com/integrations):

- [**Make**](https://docs.apify.com/platform/integrations/make) - Automate multi-step workflows
- [**Zapier**](https://docs.apify.com/platform/integrations/zapier) - Connect with 5,000+ apps
- [**Slack**](https://docs.apify.com/platform/integrations/slack) - Pipe funding-rate alerts into channels
- [**Airbyte**](https://docs.apify.com/platform/integrations/airbyte) - Land ticker data in your warehouse
- [**GitHub**](https://docs.apify.com/platform/integrations/github) - Trigger runs from commits and releases
- [**Google Drive**](https://docs.apify.com/platform/integrations/drive) - Export datasets to Sheets

You can also use webhooks to trigger downstream actions when a run finishes.

***

### 🔗 Recommended Actors

- [**🏦 Binance Crypto Prices Scraper**](https://apify.com/parseforge/binance-prices-scraper) - Spot tickers on the largest CEX
- [**📊 Bybit Tickers Scraper**](https://apify.com/parseforge/bybit-tickers-scraper) - Bybit spot and derivatives tickers
- [**🐙 Kraken Crypto Exchange Scraper**](https://apify.com/parseforge/kraken-exchange-scraper) - Kraken spot and futures
- [**📈 MEXC Crypto Tickers Scraper**](https://apify.com/parseforge/mexc-tickers-scraper) - MEXC spot and perpetual tickers
- [**🦎 CoinGecko Cryptocurrency Scraper**](https://apify.com/parseforge/coingecko-scraper) - Cross-exchange aggregated coin data

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more crypto exchange and derivatives scrapers.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) to request a new scraper, propose a custom data project, or report an issue.

***

> **⚠️ Disclaimer:** this Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Phemex. All trademarks mentioned are the property of their respective owners. Only publicly available product and ticker data exposed by Phemex's public market-data endpoints is collected. This Actor is for informational use only and does not constitute financial advice.

# Actor input Schema

## `productType` (type: `string`):

Filter results by Phemex product type. Leave empty for all.

## `quoteCurrency` (type: `string`):

Filter by quote currency (e.g. USDT, USD, USDC, BTC). Leave empty for all.

## `statusFilter` (type: `string`):

Only include products with this status.

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## `sortBy` (type: `string`):

Order results before applying maxItems.

## Actor input object example

```json
{
  "productType": "",
  "quoteCurrency": "",
  "statusFilter": "Listed",
  "maxItems": 10,
  "sortBy": "turnoverUsd"
}
```

# Actor output Schema

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

Overview of scraped data

## `fullData` (type: `string`):

Complete dataset

# 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 = {
    "productType": "",
    "quoteCurrency": "",
    "statusFilter": "Listed",
    "maxItems": 10,
    "sortBy": "turnoverUsd"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/phemex-tickers-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 = {
    "productType": "",
    "quoteCurrency": "",
    "statusFilter": "Listed",
    "maxItems": 10,
    "sortBy": "turnoverUsd",
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/phemex-tickers-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 '{
  "productType": "",
  "quoteCurrency": "",
  "statusFilter": "Listed",
  "maxItems": 10,
  "sortBy": "turnoverUsd"
}' |
apify call parseforge/phemex-tickers-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Phemex Crypto Tickers Scraper",
        "description": "Scrape live spot and perpetual tickers from Phemex public API. Returns last price, 24h open/high/low/volume/turnover, price change percent for every product type. No API key required.",
        "version": "0.0",
        "x-build-id": "RfeyklCfYenVoma7a"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~phemex-tickers-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-phemex-tickers-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/parseforge~phemex-tickers-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-phemex-tickers-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/parseforge~phemex-tickers-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-phemex-tickers-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",
                "properties": {
                    "productType": {
                        "title": "Product Type",
                        "enum": [
                            "",
                            "Spot",
                            "Perpetual",
                            "PerpetualV2",
                            "PerpetualPilot"
                        ],
                        "type": "string",
                        "description": "Filter results by Phemex product type. Leave empty for all.",
                        "default": ""
                    },
                    "quoteCurrency": {
                        "title": "Quote Currency Filter",
                        "enum": [
                            "",
                            "USDT",
                            "USD",
                            "USDC",
                            "BTC",
                            "ETH",
                            "TRY"
                        ],
                        "type": "string",
                        "description": "Filter by quote currency (e.g. USDT, USD, USDC, BTC). Leave empty for all.",
                        "default": ""
                    },
                    "statusFilter": {
                        "title": "Status Filter",
                        "enum": [
                            "",
                            "Listed",
                            "Delisted",
                            "Suspended"
                        ],
                        "type": "string",
                        "description": "Only include products with this status.",
                        "default": "Listed"
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    },
                    "sortBy": {
                        "title": "Sort By",
                        "enum": [
                            "",
                            "turnoverUsd",
                            "volume24h",
                            "priceChangePercent24h",
                            "lastPrice",
                            "symbol"
                        ],
                        "type": "string",
                        "description": "Order results before applying maxItems.",
                        "default": "turnoverUsd"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
