{
 "openapi": "3.0.3",
 "info": {
  "title": "Nervebane",
  "version": "1.0.0",
  "description": "Small paid data calls for AI agents, x402 USDC on Base.",
  "contact": {
   "name": "Space Command Kits",
   "email": "spacecommand+x402@mail.grokbot.com"
  }
 },
 "servers": [
  {
   "url": "https://nervebane.restockalarm.workers.dev"
  }
 ],
 "paths": {
  "/v1/air-quality-now": {
   "get": {
    "operationId": "air_quality_now",
    "summary": "Current air quality (US AQI, PM2.5, PM10)",
    "description": "Current air quality (US AQI, PM2.5, PM10). Returns us_aqi, pm2_5, pm10 as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "lat",
      "in": "query",
      "required": true,
      "description": "Latitude",
      "schema": {
       "type": "string",
       "pattern": "^-?\\d{1,2}(\\.\\d{1,6})?$"
      },
      "example": "52.52"
     },
     {
      "name": "lon",
      "in": "query",
      "required": true,
      "description": "Longitude",
      "schema": {
       "type": "string",
       "pattern": "^-?\\d{1,3}(\\.\\d{1,6})?$"
      },
      "example": "13.41"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "us_aqi": {
           "type": "number"
          },
          "pm2_5": {
           "type": "number"
          },
          "pm10": {
           "type": "number"
          }
         }
        },
        "example": {
         "us_aqi": 58,
         "pm2_5": 16.2,
         "pm10": 18.7
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/bitcoin-difficulty": {
   "get": {
    "operationId": "bitcoin_difficulty",
    "summary": "Bitcoin difficulty adjustment progress",
    "description": "Bitcoin difficulty adjustment progress. Returns progress_pct, est_change_pct, remaining_blocks as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "progress_pct": {
           "type": "number"
          },
          "est_change_pct": {
           "type": "number"
          },
          "remaining_blocks": {
           "type": "number"
          }
         }
        },
        "example": {
         "progress_pct": 31.25,
         "est_change_pct": -1.5713230935618272,
         "remaining_blocks": 1386
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/bitcoin-fees": {
   "get": {
    "operationId": "bitcoin_fees",
    "summary": "Recommended Bitcoin fee rates (sat/vB)",
    "description": "Recommended Bitcoin fee rates (sat/vB). Returns fastest, half_hour, hour, economy as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "fastest": {
           "type": "number"
          },
          "half_hour": {
           "type": "number"
          },
          "hour": {
           "type": "number"
          },
          "economy": {
           "type": "number"
          }
         }
        },
        "example": {
         "fastest": 1,
         "half_hour": 1,
         "hour": 1,
         "economy": 1
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/book-by-isbn": {
   "get": {
    "operationId": "book_by_isbn",
    "summary": "Book title by ISBN (Open Library)",
    "description": "Book title by ISBN (Open Library). Returns title, publish_date as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "isbn",
      "in": "query",
      "required": true,
      "description": "ISBN-10 or ISBN-13",
      "schema": {
       "type": "string",
       "pattern": "^[0-9Xx]{10,13}$"
      },
      "example": "9780140328721"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "title": {
           "type": "string"
          },
          "publish_date": {
           "type": "string"
          }
         }
        },
        "example": {
         "title": "Fantastic Mr. Fox",
         "publish_date": "October 1, 1988"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/crypto-24h-stats": {
   "get": {
    "operationId": "crypto_24h_stats",
    "summary": "Crypto 24h stats in USD (open/high/low/last/volume)",
    "description": "Crypto 24h stats in USD (open/high/low/last/volume). Returns last_usd, open_usd, high_usd, low_usd, volume_24h as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "symbol",
      "in": "query",
      "required": true,
      "description": "Crypto ticker, e.g. BTC, ETH",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9]{2,10}$"
      },
      "example": "BTC"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "last_usd": {
           "type": "number"
          },
          "open_usd": {
           "type": "number"
          },
          "high_usd": {
           "type": "number"
          },
          "low_usd": {
           "type": "number"
          },
          "volume_24h": {
           "type": "number"
          }
         }
        },
        "example": {
         "last_usd": 76460.4,
         "open_usd": 78037.7,
         "high_usd": 78280.38,
         "low_usd": 76412,
         "volume_24h": 7376.96296495
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/crypto-spot-price": {
   "get": {
    "operationId": "crypto_spot_price",
    "summary": "Crypto spot price in USD",
    "description": "Crypto spot price in USD. Returns price_usd, symbol as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "symbol",
      "in": "query",
      "required": true,
      "description": "Crypto ticker, e.g. BTC, ETH",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9]{2,10}$"
      },
      "example": "BTC"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "price_usd": {
           "type": "number"
          },
          "symbol": {
           "type": "string"
          }
         }
        },
        "example": {
         "price_usd": 76463.875,
         "symbol": "BTC"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/currency-to-usd": {
   "get": {
    "operationId": "currency_to_usd",
    "summary": "Value of one unit of a currency or coin in USD",
    "description": "Value of one unit of a currency or coin in USD. Returns usd, currency as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "currency",
      "in": "query",
      "required": true,
      "description": "Currency or coin code",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9]{2,10}$"
      },
      "example": "EUR"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "usd": {
           "type": "number"
          },
          "currency": {
           "type": "string"
          }
         }
        },
        "example": {
         "usd": 1.1193288682448224,
         "currency": "EUR"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/earthquakes-24h": {
   "get": {
    "operationId": "earthquakes_24h",
    "summary": "Number of M2.5+ earthquakes worldwide in the last 24 hours (USGS)",
    "description": "Number of M2.5+ earthquakes worldwide in the last 24 hours (USGS). Returns count, generated_ms as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "count": {
           "type": "number"
          },
          "generated_ms": {
           "type": "number"
          }
         }
        },
        "example": {
         "count": 42,
         "generated_ms": 1793685913000
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/fiat-fx-rate": {
   "get": {
    "operationId": "fiat_fx_rate",
    "summary": "Fiat exchange rate (ECB reference)",
    "description": "Fiat exchange rate (ECB reference). Returns rate, date as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": true,
      "description": "ISO 4217 base currency",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z]{3}$"
      },
      "example": "USD"
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "description": "ISO 4217 target currency",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z]{3}$"
      },
      "example": "EUR"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "rate": {
           "type": "number"
          },
          "date": {
           "type": "string"
          }
         }
        },
        "example": {
         "rate": 0.89158,
         "date": "2026-11-02"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/geocode-city": {
   "get": {
    "operationId": "geocode_city",
    "summary": "City name to coordinates",
    "description": "City name to coordinates. Returns name, country, latitude, longitude, timezone as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "city",
      "in": "query",
      "required": true,
      "description": "City name",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z .'-]{2,60}$"
      },
      "example": "Copenhagen"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "name": {
           "type": "string"
          },
          "country": {
           "type": "string"
          },
          "latitude": {
           "type": "number"
          },
          "longitude": {
           "type": "number"
          },
          "timezone": {
           "type": "string"
          }
         }
        },
        "example": {
         "name": "Copenhagen",
         "country": "Denmark",
         "latitude": 55.67594,
         "longitude": 12.56553,
         "timezone": "Europe/Copenhagen"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/npm-latest-version": {
   "get": {
    "operationId": "npm_latest_version",
    "summary": "Latest version of an npm package",
    "description": "Latest version of an npm package. Returns name, version as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "package",
      "in": "query",
      "required": true,
      "description": "npm package name",
      "schema": {
       "type": "string",
       "pattern": "^(@[a-z0-9][a-z0-9._~-]*/)?[a-z0-9][a-z0-9._~-]{0,100}$"
      },
      "example": "hono"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "name": {
           "type": "string"
          },
          "version": {
           "type": "string"
          }
         }
        },
        "example": {
         "name": "hono",
         "version": "4.13.16"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/npm-weekly-downloads": {
   "get": {
    "operationId": "npm_weekly_downloads",
    "summary": "npm package downloads last week",
    "description": "npm package downloads last week. Returns downloads, start, end as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "package",
      "in": "query",
      "required": true,
      "description": "npm package name",
      "schema": {
       "type": "string",
       "pattern": "^(@[a-z0-9][a-z0-9._~-]*/)?[a-z0-9][a-z0-9._~-]{0,100}$"
      },
      "example": "hono"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "downloads": {
           "type": "number"
          },
          "start": {
           "type": "string"
          },
          "end": {
           "type": "string"
          }
         }
        },
        "example": {
         "downloads": 101486097,
         "start": "2026-10-26",
         "end": "2026-11-01"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/postal-code-lookup": {
   "get": {
    "operationId": "postal_code_lookup",
    "summary": "Postal code to place and coordinates",
    "description": "Postal code to place and coordinates. Returns place, state, latitude, longitude as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "required": true,
      "description": "ISO 3166-1 alpha-2 country code",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z]{2}$"
      },
      "example": "US"
     },
     {
      "name": "zip",
      "in": "query",
      "required": true,
      "description": "Postal code",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9 -]{3,10}$"
      },
      "example": "90210"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "place": {
           "type": "string"
          },
          "state": {
           "type": "string"
          },
          "latitude": {
           "type": "number"
          },
          "longitude": {
           "type": "number"
          }
         }
        },
        "example": {
         "place": "Beverly Hills",
         "state": "California",
         "latitude": 34.0901,
         "longitude": -118.4065
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/pypi-latest-version": {
   "get": {
    "operationId": "pypi_latest_version",
    "summary": "Latest version of a PyPI package",
    "description": "Latest version of a PyPI package. Returns name, version as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "package",
      "in": "query",
      "required": true,
      "description": "PyPI package name",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9._-]{1,100}$"
      },
      "example": "requests"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "name": {
           "type": "string"
          },
          "version": {
           "type": "string"
          }
         }
        },
        "example": {
         "name": "requests",
         "version": "2.34.2"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/sun-times": {
   "get": {
    "operationId": "sun_times",
    "summary": "Sunrise and sunset (UTC) for a location",
    "description": "Sunrise and sunset (UTC) for a location. Returns sunrise_utc, sunset_utc, day_length_s as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "lat",
      "in": "query",
      "required": true,
      "description": "Latitude",
      "schema": {
       "type": "string",
       "pattern": "^-?\\d{1,2}(\\.\\d{1,6})?$"
      },
      "example": "55.68"
     },
     {
      "name": "lon",
      "in": "query",
      "required": true,
      "description": "Longitude",
      "schema": {
       "type": "string",
       "pattern": "^-?\\d{1,3}(\\.\\d{1,6})?$"
      },
      "example": "12.57"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sunrise_utc": {
           "type": "string"
          },
          "sunset_utc": {
           "type": "string"
          },
          "day_length_s": {
           "type": "number"
          }
         }
        },
        "example": {
         "sunrise_utc": "2026-11-03T06:19:53+00:00",
         "sunset_utc": "2026-11-03T15:26:39+00:00",
         "day_length_s": 32806
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/uv-index-now": {
   "get": {
    "operationId": "uv_index_now",
    "summary": "Current UV index at a location",
    "description": "Current UV index at a location. Returns uv_index, time as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "lat",
      "in": "query",
      "required": true,
      "description": "Latitude",
      "schema": {
       "type": "string",
       "pattern": "^-?\\d{1,2}(\\.\\d{1,6})?$"
      },
      "example": "40.71"
     },
     {
      "name": "lon",
      "in": "query",
      "required": true,
      "description": "Longitude",
      "schema": {
       "type": "string",
       "pattern": "^-?\\d{1,3}(\\.\\d{1,6})?$"
      },
      "example": "-74.01"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "uv_index": {
           "type": "number"
          },
          "time": {
           "type": "string"
          }
         }
        },
        "example": {
         "uv_index": 0,
         "time": "2026-11-03T06:00"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/wave-height-now": {
   "get": {
    "operationId": "wave_height_now",
    "summary": "Current sea wave height",
    "description": "Current sea wave height. Returns wave_height_m, time as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "lat",
      "in": "query",
      "required": true,
      "description": "Latitude",
      "schema": {
       "type": "string",
       "pattern": "^-?\\d{1,2}(\\.\\d{1,6})?$"
      },
      "example": "54.5"
     },
     {
      "name": "lon",
      "in": "query",
      "required": true,
      "description": "Longitude",
      "schema": {
       "type": "string",
       "pattern": "^-?\\d{1,3}(\\.\\d{1,6})?$"
      },
      "example": "-30.0"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "wave_height_m": {
           "type": "number"
          },
          "time": {
           "type": "string"
          }
         }
        },
        "example": {
         "wave_height_m": 4.42,
         "time": "2026-11-03T06:00"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/weather-now": {
   "get": {
    "operationId": "weather_now",
    "summary": "Current weather at a location",
    "description": "Current weather at a location. Returns temperature_c, humidity_pct, wind_kmh, time as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "lat",
      "in": "query",
      "required": true,
      "description": "Latitude",
      "schema": {
       "type": "string",
       "pattern": "^-?\\d{1,2}(\\.\\d{1,6})?$"
      },
      "example": "55.68"
     },
     {
      "name": "lon",
      "in": "query",
      "required": true,
      "description": "Longitude",
      "schema": {
       "type": "string",
       "pattern": "^-?\\d{1,3}(\\.\\d{1,6})?$"
      },
      "example": "12.57"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "temperature_c": {
           "type": "number"
          },
          "humidity_pct": {
           "type": "number"
          },
          "wind_kmh": {
           "type": "number"
          },
          "time": {
           "type": "string"
          }
         }
        },
        "example": {
         "temperature_c": 8.7,
         "humidity_pct": 82,
         "wind_kmh": 11.2,
         "time": "2026-11-03T06:00"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/wikipedia-summary": {
   "get": {
    "operationId": "wikipedia_summary",
    "summary": "Wikipedia page summary (English)",
    "description": "Wikipedia page summary (English). Returns title, extract as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "title",
      "in": "query",
      "required": true,
      "description": "Page title, spaces as underscores",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9_().,'-]{1,100}$"
      },
      "example": "Bitcoin"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "title": {
           "type": "string"
          },
          "extract": {
           "type": "string"
          }
         }
        },
        "example": {
         "title": "Bitcoin",
         "extract": "Bitcoin is the first decentralized cryptocurrency. Based on a free-market ideology, bitcoin was invented in 2008 when an unknown person published a white paper under the pseudonym of Satoshi Nakamoto. Use of bitcoin as a currency began in 2009, with the release of its open-source implementation. From 2021 to 2025, El Salvador adopted it as legal tender currency before revoking it. As bitcoin is pseudonymous, its use by criminals has attracted the attention of regulators, leading to its ban by several countries."
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/word-definition": {
   "get": {
    "operationId": "word_definition",
    "summary": "English word definition",
    "description": "English word definition. Returns word, part_of_speech, definition as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "word",
      "in": "query",
      "required": true,
      "description": "English word",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z-]{1,40}$"
      },
      "example": "agent"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "word": {
           "type": "string"
          },
          "part_of_speech": {
           "type": "string"
          },
          "definition": {
           "type": "string"
          }
         }
        },
        "example": {
         "word": "agent",
         "part_of_speech": "noun",
         "definition": "One who exerts power, or has the power to act"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/crate-latest-version": {
   "get": {
    "operationId": "crate_latest_version",
    "summary": "Latest version of a Rust crate",
    "description": "Latest version of a Rust crate. Returns max_version, downloads as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "crate",
      "in": "query",
      "required": true,
      "description": "crates.io crate name",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9_-]{1,64}$"
      },
      "example": "serde"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "max_version": {
           "type": "string"
          },
          "downloads": {
           "type": "number"
          }
         }
        },
        "example": {
         "max_version": "1.0.229",
         "downloads": 1635385243
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/next-public-holiday": {
   "get": {
    "operationId": "next_public_holiday",
    "summary": "Next public holiday in a country",
    "description": "Next public holiday in a country. Returns date, name, local_name as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "required": true,
      "description": "ISO 3166-1 alpha-2 country code",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z]{2}$"
      },
      "example": "DK"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "date": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "local_name": {
           "type": "string"
          }
         }
        },
        "example": {
         "date": "2026-12-25",
         "name": "Christmas Day",
         "local_name": "Juledag / 1. juledag"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/country-gdp-usd": {
   "get": {
    "operationId": "country_gdp_usd",
    "summary": "Country GDP in current USD (World Bank)",
    "description": "Country GDP in current USD (World Bank). Returns gdp_usd, year as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "required": true,
      "description": "ISO 3166-1 alpha-2 country code",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z]{2}$"
      },
      "example": "DK"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "gdp_usd": {
           "type": "number"
          },
          "year": {
           "type": "string"
          }
         }
        },
        "example": {
         "gdp_usd": 462526660468.393,
         "year": "2025"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/country-population": {
   "get": {
    "operationId": "country_population",
    "summary": "Country population (World Bank)",
    "description": "Country population (World Bank). Returns population, year as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "required": true,
      "description": "ISO 3166-1 alpha-2 country code",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z]{2}$"
      },
      "example": "DK"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "population": {
           "type": "number"
          },
          "year": {
           "type": "string"
          }
         }
        },
        "example": {
         "population": 6009169,
         "year": "2025"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/inflation-rate": {
   "get": {
    "operationId": "inflation_rate",
    "summary": "Country annual inflation rate, consumer prices (World Bank)",
    "description": "Country annual inflation rate, consumer prices (World Bank). Returns inflation_pct, year as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "required": true,
      "description": "ISO 3166-1 alpha-2 country code",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z]{2}$"
      },
      "example": "DK"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "inflation_pct": {
           "type": "number"
          },
          "year": {
           "type": "string"
          }
         }
        },
        "example": {
         "inflation_pct": 1.8900606245861,
         "year": "2025"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/dns-a-record": {
   "get": {
    "operationId": "dns_a_record",
    "summary": "DNS A record lookup for a domain",
    "description": "DNS A record lookup for a domain. Returns ip, ttl, status as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "domain",
      "in": "query",
      "required": true,
      "description": "Domain name",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9.-]{3,253}$"
      },
      "example": "example.com"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ip": {
           "type": "string"
          },
          "ttl": {
           "type": "number"
          },
          "status": {
           "type": "number"
          }
         }
        },
        "example": {
         "ip": "104.20.23.154",
         "ttl": 300,
         "status": 0
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/github-repo-stats": {
   "get": {
    "operationId": "github_repo_stats",
    "summary": "GitHub repository stars and last push",
    "description": "GitHub repository stars and last push. Returns stars, pushed_at as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "owner",
      "in": "query",
      "required": true,
      "description": "Owner",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9-]{1,39}$"
      },
      "example": "coinbase"
     },
     {
      "name": "repo",
      "in": "query",
      "required": true,
      "description": "Repository",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9._-]{1,100}$"
      },
      "example": "x402"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "stars": {
           "type": "number"
          },
          "pushed_at": {
           "type": "string"
          }
         }
        },
        "example": {
         "stars": 178,
         "pushed_at": "2026-11-03T05:02:21Z"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/v1/hn-story-search": {
   "get": {
    "operationId": "hn_story_search",
    "summary": "Top Hacker News story matching a query",
    "description": "Top Hacker News story matching a query. Returns hits, top_title as JSON. Pay per call via x402. $0.01 USDC per call via x402 on Base.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "Search words",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9 ._-]{2,60}$"
      },
      "example": "x402"
     }
    ],
    "x-payment-info": {
     "price": "$0.01",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "hits": {
           "type": "number"
          },
          "top_title": {
           "type": "string"
          }
         }
        },
        "example": {
         "hits": 9710,
         "top_title": "Monetization Gateway: Charge for any resource behind Cloudflare via x402"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "402": {
      "description": "Payment Required (x402)"
     },
     "503": {
      "description": "Upstream unavailable, not charged"
     }
    }
   }
  },
  "/pass/month": {
   "post": {
    "operationId": "buy_pass_month",
    "summary": "Catalog pass, 30 days",
    "description": "Pays $1 via x402 and returns an X-Pass-Key (shown once) valid on every /v1/* route and /mcp for 30 days.",
    "x-payment-info": {
     "price": "$1",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "pass_key, kind, expires"
     },
     "402": {
      "description": "Payment Required (x402)"
     }
    }
   }
  },
  "/pass/10d": {
   "post": {
    "operationId": "buy_pass_pass10d",
    "summary": "Catalog pass, 10 days",
    "description": "Pays $0.5 via x402 and returns an X-Pass-Key (shown once) valid on every /v1/* route and /mcp for 10 days.",
    "x-payment-info": {
     "price": "$0.5",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "pass_key, kind, expires"
     },
     "402": {
      "description": "Payment Required (x402)"
     }
    }
   }
  },
  "/tip": {
   "get": {
    "operationId": "tip",
    "summary": "Optional tip",
    "x-payment-info": {
     "price": "$0.05",
     "network": "eip155:8453",
     "asset": "USDC",
     "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
    },
    "responses": {
     "200": {
      "description": "Thanks"
     },
     "402": {
      "description": "Payment Required (x402)"
     }
    }
   }
  },
  "/stats": {
   "get": {
    "operationId": "stats",
    "summary": "Public counters (offers, sales, passes)",
    "responses": {
     "200": {
      "description": "Counts"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "PassKey": {
    "type": "apiKey",
    "in": "header",
    "name": "X-Pass-Key",
    "description": "Catalog pass from POST /pass/month or /pass/10d"
   }
  }
 }
}