{
  "openapi": "3.0.1",
  "info": {
    "title": "Crypto Market Scraper — CoinMarketCap & CoinGecko",
    "description": "One actor, two sources. Scrape CoinMarketCap + CoinGecko: top-coin listings, coin details, trending, categories, exchanges, historical/OHLC. Derived analytics + cross-run price monitoring. No API key.",
    "version": "0.0",
    "x-build-id": "9b96w6vP7YgcK30jB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/brilliant_gum~crypto-market-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-brilliant_gum-crypto-market-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/brilliant_gum~crypto-market-scraper/runs": {
      "post": {
        "operationId": "runs-sync-brilliant_gum-crypto-market-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/brilliant_gum~crypto-market-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-brilliant_gum-crypto-market-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": [
          "source",
          "mode"
        ],
        "properties": {
          "source": {
            "title": "Data source",
            "enum": [
              "both",
              "cmc",
              "coingecko"
            ],
            "type": "string",
            "description": "Which market to scrape: 'both' (CoinMarketCap + CoinGecko, merged), 'cmc' (CoinMarketCap only) or 'coingecko' (CoinGecko only). Both use free, no-key public endpoints.",
            "default": "both"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "listings",
              "coin-details",
              "trending",
              "categories",
              "exchanges",
              "historical"
            ],
            "type": "string",
            "description": "What to fetch. listings = top-N coins market table; coin-details = full info for specific coins; trending = trending/gainers/losers; categories = sectors/categories; exchanges = exchange rankings; historical = price/OHLC chart for specific coins.",
            "default": "listings"
          },
          "coins": {
            "title": "Coins (for coin-details / historical)",
            "type": "array",
            "description": "List of coins for coin-details and historical modes. Accepts symbols (BTC), CoinGecko ids/CMC slugs (bitcoin), numeric CMC ids, or full URLs (coinmarketcap.com/currencies/bitcoin/ or coingecko.com/en/coins/bitcoin). Ignored for listings/trending/categories/exchanges.",
            "items": {
              "type": "string"
            }
          },
          "vsCurrency": {
            "title": "Quote currency",
            "type": "string",
            "description": "Fiat/crypto currency prices are quoted in (e.g. usd, eur, gbp, jpy, btc, eth). Applied to all modes.",
            "default": "usd"
          },
          "vsCurrencies": {
            "title": "Extra quote currencies (CoinGecko)",
            "type": "array",
            "description": "Optional additional quote currencies for CoinGecko coin-details price block (e.g. eur, btc). Leave empty to use only the main quote currency.",
            "items": {
              "type": "string"
            }
          },
          "limit": {
            "title": "Coins per page / total in listings",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many coins to request per listings page. Combined with maxItems to page through the market table. Ignored in coin-details/historical.",
            "default": 100
          },
          "maxItems": {
            "title": "Max output records",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on the number of records pushed to the dataset for the whole run (across pages and sources).",
            "default": 100
          },
          "startRank": {
            "title": "Start rank (listings)",
            "minimum": 1,
            "type": "integer",
            "description": "1-based rank to start the listings table from (e.g. 101 to skip the top 100). Ignored in other modes.",
            "default": 1
          },
          "category": {
            "title": "Category filter (listings)",
            "type": "string",
            "description": "Restrict listings to one category/sector. For CoinGecko use the category id (e.g. decentralized-finance-defi, layer-1, meme-token); for CMC a tag slug. Leave empty for all coins."
          },
          "sortBy": {
            "title": "Sort by (listings)",
            "enum": [
              "market_cap",
              "volume_24h",
              "price",
              "percent_change_1h",
              "percent_change_24h",
              "percent_change_7d",
              "circulating_supply",
              "date_added"
            ],
            "type": "string",
            "description": "Sort key for listings. market_cap, volume_24h, price, percent_change_1h, percent_change_24h, percent_change_7d, circulating_supply, date_added.",
            "default": "market_cap"
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Sort direction for listings: desc (highest first) or asc (lowest first).",
            "default": "desc"
          },
          "trendingType": {
            "title": "Trending list type",
            "enum": [
              "trending",
              "gainers",
              "losers",
              "most_visited",
              "recently_added"
            ],
            "type": "string",
            "description": "Which trending list to return in trending mode. trending = most-searched; gainers/losers = top movers 24h; most_visited; recently_added = new listings. CoinGecko only supports 'trending'; the others use CoinMarketCap.",
            "default": "trending"
          },
          "days": {
            "title": "Historical timeframe (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Historical mode: number of days of price history to fetch (1-3650). CoinGecko free supports up to 365 days; CMC supports longer ranges. Ignored in other modes.",
            "default": 7
          },
          "ohlc": {
            "title": "OHLC candles (historical)",
            "type": "boolean",
            "description": "Historical mode: return OHLC candles (open/high/low/close per interval) instead of a price/volume/market-cap time series.",
            "default": false
          },
          "includeChart": {
            "title": "Attach chart to coin-details",
            "type": "boolean",
            "description": "coin-details mode: also fetch and attach a price history/sparkline (uses the 'days' timeframe) to each coin record.",
            "default": false
          },
          "includeDetails": {
            "title": "Include market details",
            "type": "boolean",
            "description": "Attach the full market block (market cap, volume, 24h high/low, supply, % changes) to each record. Turn off for a lean price-only output.",
            "default": true
          },
          "includeAnalytics": {
            "title": "Include derived analytics",
            "type": "boolean",
            "description": "Attach a computed analytics block: volume/market-cap ratio, 24h volatility, ATH/ATL distance %, supply-issued %, FDV/market-cap ratio, momentum score.",
            "default": true
          },
          "minMarketCap": {
            "title": "Min market cap",
            "type": "integer",
            "description": "Keep only coins with market cap >= this value (in the quote currency). Leave empty for no minimum."
          },
          "maxMarketCap": {
            "title": "Max market cap",
            "type": "integer",
            "description": "Keep only coins with market cap <= this value. Leave empty for no maximum."
          },
          "minVolume24h": {
            "title": "Min 24h volume",
            "type": "integer",
            "description": "Keep only coins with 24h trading volume >= this value. Leave empty for no minimum."
          },
          "minPrice": {
            "title": "Min price",
            "type": "number",
            "description": "Keep only coins with price >= this value. Leave empty for no minimum."
          },
          "maxPrice": {
            "title": "Max price",
            "type": "number",
            "description": "Keep only coins with price <= this value. Leave empty for no maximum."
          },
          "minPercentChange24h": {
            "title": "Min 24h % change",
            "type": "number",
            "description": "Keep only coins whose 24h price change % is >= this value (e.g. 5 for pumps, -100 for all). Leave empty to ignore."
          },
          "maxPercentChange24h": {
            "title": "Max 24h % change",
            "type": "number",
            "description": "Keep only coins whose 24h price change % is <= this value. Leave empty to ignore."
          },
          "trackChanges": {
            "title": "Cross-run price monitoring",
            "type": "boolean",
            "description": "Compare each coin against the previous run stored in the actor's key-value store and attach a monitoring block (price/market-cap delta since last run, minutes since last seen, isNew).",
            "default": false
          },
          "onlyChanged": {
            "title": "Only output changed coins",
            "type": "boolean",
            "description": "With cross-run monitoring on, push only coins whose price changed since the previous run (skip unchanged). Great for scheduled price-alert runs.",
            "default": false
          },
          "dedup": {
            "title": "Deduplicate",
            "type": "boolean",
            "description": "Remove duplicate coins (same source + id) within a run. Useful when merging both sources or paging.",
            "default": true
          },
          "flat": {
            "title": "Flat output rows",
            "type": "boolean",
            "description": "Emit flat/denormalized rows (nested price-change, supply and analytics fields hoisted to top level) for easy CSV/spreadsheet export.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy. The public endpoints work directly; enable Apify Proxy (datacenter, or residential US) if you hit rate limits (HTTP 429) at scale.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}