{
  "openapi": "3.1.0",
  "info": {
    "title": "NoJunk Crypto Price",
    "version": "1.0.0",
    "description": "Current USD price, market cap, 24h volume and 24h change for up to 10 cryptocurrencies by ticker symbol (BTC, ETH, SOL, ...) or for any on-chain token by contract address and chain (ethereum, base, bsc, arbitrum, polygon, optimism, avalanche, solana). Data from CoinGecko.",
    "x-guidance": "Use GET /price?symbol=BTC,ETH,SOL (up to 10 tickers; or POST /price with JSON {symbol: [...]}) for a quick current USD price with market cap, 24h volume and 24h % change. For a token that is not a listed ticker, use ?address=0x...&chain=base (chains: ethereum, base, bsc, arbitrum, polygon, optimism, avalanche, solana). Costs $0.001 USDC on Base per request via x402; nothing is charged for unknown symbols (listed in `unknown`), 400/404 or upstream failures. Data is from CoinGecko and cached about 30 seconds — when you show the price, include the `attribution` string (Powered by CoinGecko). Not investment advice."
  },
  "servers": [
    {
      "url": "https://nojunk-crypto-price.mick8511.workers.dev"
    }
  ],
  "paths": {
    "/price": {
      "get": {
        "operationId": "getPrice",
        "summary": "Current USD price, market cap, 24h volume and 24h change for crypto tickers or an on-chain token",
        "tags": [
          "Crypto",
          "Finance",
          "Prices"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Ticker symbol or comma-separated list of up to 10 (JSON array also accepted in POST), e.g. 'BTC' or 'BTC,ETH,SOL'. Use this OR address+chain."
          },
          {
            "name": "address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Token contract address (0x... for EVM chains, base58 mint for Solana). Requires chain."
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Chain of the contract address."
          }
        ],
        "responses": {
          "200": {
            "description": "Prices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "query": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string",
                            "description": "CoinGecko coin id or on-chain token id"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "symbol": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "price_usd": {
                            "type": "number"
                          },
                          "market_cap_usd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "volume_24h_usd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "change_24h_pct": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "last_updated": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "chain": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "fdv_usd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "liquidity_usd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "decimals": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "query",
                          "id",
                          "price_usd"
                        ]
                      }
                    },
                    "unknown": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Requested symbols that were not recognised or had no data"
                    },
                    "source": {
                      "type": "string"
                    },
                    "attribution": {
                      "type": "string",
                      "description": "Must be displayed when surfacing the data: Powered by CoinGecko"
                    },
                    "fetched_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "results",
                    "unknown",
                    "source",
                    "attribution",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "No recognised symbols / token not found (no charge)"
          },
          "413": {
            "description": "Request too large (no charge)"
          },
          "502": {
            "description": "CoinGecko temporarily unavailable (no charge)"
          }
        }
      },
      "post": {
        "operationId": "getPricePost",
        "summary": "Current USD price, market cap, 24h volume and 24h change for crypto tickers or an on-chain token",
        "tags": [
          "Crypto",
          "Finance",
          "Prices"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol or comma-separated list of up to 10 (JSON array also accepted in POST), e.g. 'BTC' or 'BTC,ETH,SOL'. Use this OR address+chain."
                  },
                  "address": {
                    "type": "string",
                    "description": "Token contract address (0x... for EVM chains, base58 mint for Solana). Requires chain."
                  },
                  "chain": {
                    "type": "string",
                    "enum": [
                      "ethereum",
                      "base",
                      "bsc",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche",
                      "solana"
                    ],
                    "description": "Chain of the contract address."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Prices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "query": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string",
                            "description": "CoinGecko coin id or on-chain token id"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "symbol": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "price_usd": {
                            "type": "number"
                          },
                          "market_cap_usd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "volume_24h_usd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "change_24h_pct": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "last_updated": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "chain": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "fdv_usd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "liquidity_usd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "decimals": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "query",
                          "id",
                          "price_usd"
                        ]
                      }
                    },
                    "unknown": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Requested symbols that were not recognised or had no data"
                    },
                    "source": {
                      "type": "string"
                    },
                    "attribution": {
                      "type": "string",
                      "description": "Must be displayed when surfacing the data: Powered by CoinGecko"
                    },
                    "fetched_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "results",
                    "unknown",
                    "source",
                    "attribution",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "No recognised symbols / token not found (no charge)"
          },
          "413": {
            "description": "Request too large (no charge)"
          },
          "502": {
            "description": "CoinGecko temporarily unavailable (no charge)"
          }
        }
      }
    }
  }
}