{
  "openapi": "3.0.1",
  "info": {
    "title": "CoinGecko markets - coin prices, caps, volumes, history (API)",
    "description": "Read CoinGecko's public API v3 and get one flat row per coin (price, market cap, rank, volume, 24h/7d change, ATH, supply), per day of price history, per trending coin or per category. Optional demo/pro API key. Default: top 250 coins by market cap in USD, one request.",
    "version": "0.1",
    "x-build-id": "pnw3MGj3YeSMqfEiK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/retrainmap~coingecko-markets/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-retrainmap-coingecko-markets",
        "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/retrainmap~coingecko-markets/runs": {
      "post": {
        "operationId": "runs-sync-retrainmap-coingecko-markets",
        "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/retrainmap~coingecko-markets/run-sync": {
      "post": {
        "operationId": "run-sync-retrainmap-coingecko-markets",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "markets",
              "coin_history",
              "trending",
              "categories"
            ],
            "type": "string",
            "description": "markets = one row per coin from /coins/markets (price, cap, rank, volume, changes, ATH, supply). coin_history = one row per day per coin from /coins/{id}/market_chart (price, cap, volume) - needs coin_ids. trending = the 15 trending coins from /search/trending. categories = one row per CoinGecko category from /coins/categories.",
            "default": "markets"
          },
          "vs_currency": {
            "title": "Quote currency",
            "type": "string",
            "description": "CoinGecko currency code prices are quoted in: usd, eur, gbp, jpy, btc, eth ... (full list: https://api.coingecko.com/api/v3/simple/supported_vs_currencies).",
            "default": "usd"
          },
          "coin_ids": {
            "title": "Coin ids",
            "uniqueItems": true,
            "type": "array",
            "description": "CoinGecko coin ids such as bitcoin, ethereum, solana (the id in the coin's coingecko.com URL; full list: /coins/list). Required for coin_history (one request per coin). Optional filter for markets. Ignored by trending and categories. An unknown id makes the API answer HTTP 404 and the run fails with that message.",
            "items": {
              "type": "string"
            }
          },
          "days": {
            "title": "History days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "coin_history only: how many days back (1-365; the public tier serves at most 365). One row per day (daily granularity; days=1 gives 5-minute points).",
            "default": 30
          },
          "order": {
            "title": "Sort order (markets)",
            "enum": [
              "market_cap_desc",
              "market_cap_asc",
              "volume_desc",
              "volume_asc",
              "id_asc",
              "id_desc"
            ],
            "type": "string",
            "description": "markets only: the API's order parameter.",
            "default": "market_cap_desc"
          },
          "max_records": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many rows. markets pages 250 coins per request (at most 2,500 = 10 requests); trending has 15 rows; categories about 760; coin_history yields days+1 rows per coin.",
            "default": 250
          },
          "api_key": {
            "title": "CoinGecko API key (optional)",
            "type": "string",
            "description": "Optional. A Demo key (free, from coingecko.com/en/developers/dashboard) raises the limit to 30 requests/minute and is sent as x-cg-demo-api-key; a paid Pro key is sent as x-cg-pro-api-key to pro-api.coingecko.com when api_tier = pro. Stored encrypted by Apify; never written to the dataset or logs."
          },
          "api_tier": {
            "title": "API key tier",
            "enum": [
              "demo",
              "pro"
            ],
            "type": "string",
            "description": "demo (default) uses api.coingecko.com; pro uses pro-api.coingecko.com and needs a paid key.",
            "default": "demo"
          },
          "request_interval_ms": {
            "title": "Minimum interval between requests (ms)",
            "minimum": 1000,
            "maximum": 60000,
            "type": "integer",
            "description": "Rate limit towards CoinGecko. Default 6500 ms (about 9 requests per minute, safe for the keyless public tier); with a Demo key 2000 ms is safe. Floor 1000 ms. The Actor also backs off 15/30/60 s on HTTP 429.",
            "default": 6500
          },
          "contact_email": {
            "title": "Contact e-mail (From: header)",
            "type": "string",
            "description": "Sent in the standard From: request header so the data owner can reach the operator (RFC 9110 s10.1.2).",
            "default": "info@steelyardclinical.com"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}