{
  "openapi": "3.1.0",
  "info": {
    "title": "NoJunk Geo",
    "version": "1.0.0",
    "description": "Cheap geocoding, reverse geocoding and weather for AI agents, paid per call in USDC on Base via x402: /geocode turns a place name or address into coordinates and a structured address, /reverse turns coordinates into an address, /weather returns current conditions and a 7-day forecast for coordinates or a place name. Data from OpenStreetMap Nominatim (ODbL, attribution required) and Open-Meteo (CC BY 4.0). You are only charged when a result is returned.",
    "x-guidance": "Cheap geocoding, reverse geocoding and weather for AI agents. Every call costs $0.002 USDC on Base via x402 and you are only charged when a result is returned (400/404/413/502 are free). GET or POST JSON. /geocode {q: place name or address (1-200 chars), limit?: 1-5 (default 1), country?: ISO2} -> {results: [{lat, lon, display_name, type, category, importance, address: {house_number, road, city, county, state, postcode, country, country_code}, bounding_box: [south, north, west, east]}]}; 404 when nothing matches. /reverse {lat, lon, zoom?: 3-18 (default 18 = building, 16 street, 10 city)} -> {display_name, address, type, category}; 404 for open water/unmapped spots. /weather {lat, lon} or {q} -> current conditions (temperature, feels-like, humidity, precipitation, wind, plain-text condition + WMO code) and a 7-day daily forecast (highs/lows, precipitation, probability, sunrise/sunset) in both metric and imperial units, with the location's time zone and local time; with q the place is geocoded first and returned as place. Geocoding data is OpenStreetMap via Nominatim (ODbL): when you show the results, credit \"© OpenStreetMap contributors\". Weather data is Open-Meteo (CC BY 4.0): credit \"Weather data by Open-Meteo.com\". The attribution field in every response holds the exact text. Geocoding results are cached for 24 hours and forecasts for 10 minutes. Best for: turning user-supplied locations into coordinates, finding the city/state/country of a point, checking the weather or forecast for a place, time-zone lookup for a location."
  },
  "servers": [
    {
      "url": "https://nojunk-geo.mick8511.workers.dev"
    }
  ],
  "paths": {
    "/geocode": {
      "get": {
        "operationId": "geocode",
        "summary": "Geocode a place name or address to coordinates, structured address and bounding box",
        "tags": [
          "Geo",
          "Location",
          "Weather",
          "geocode"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Place name or address, 1-200 characters, e.g. 'Sunrise, Florida' or '10 Downing Street, London'"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Maximum number of matches to return (1-5, default 1)"
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional ISO 3166-1 alpha-2 country code to restrict results, e.g. us, gb, de"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "results": {
                      "type": "array",
                      "minItems": 1,
                      "maxItems": 5,
                      "items": {
                        "type": "object",
                        "properties": {
                          "lat": {
                            "type": "number"
                          },
                          "lon": {
                            "type": "number"
                          },
                          "display_name": {
                            "type": "string",
                            "description": "Full human-readable name from OpenStreetMap"
                          },
                          "type": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "OSM feature type, e.g. city, house, road"
                          },
                          "category": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "OSM feature category, e.g. place, boundary, building"
                          },
                          "importance": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Nominatim relevance score, 0-1"
                          },
                          "address": {
                            "type": "object",
                            "description": "Structured address; any part the map data lacks is null. city falls back to town, village or hamlet.",
                            "properties": {
                              "house_number": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "road": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "city": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "county": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "state": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "postcode": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "country": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "country_code": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Lowercase ISO 3166-1 alpha-2"
                              }
                            },
                            "required": [
                              "house_number",
                              "road",
                              "city",
                              "county",
                              "state",
                              "postcode",
                              "country",
                              "country_code"
                            ]
                          },
                          "bounding_box": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "number"
                            },
                            "minItems": 4,
                            "maxItems": 4,
                            "description": "[south, north, west, east] in decimal degrees"
                          }
                        },
                        "required": [
                          "lat",
                          "lon",
                          "display_name",
                          "type",
                          "category",
                          "importance",
                          "address",
                          "bounding_box"
                        ]
                      },
                      "description": "Best matches first"
                    },
                    "source": {
                      "type": "string"
                    },
                    "attribution": {
                      "type": "string",
                      "description": "Required attribution text; show it wherever the data is displayed"
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "query",
                    "country",
                    "results",
                    "source",
                    "attribution",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "No place matches q (no charge)"
          },
          "413": {
            "description": "Request body too large (no charge)"
          },
          "502": {
            "description": "Data source unreachable, timed out (6 s) or returned an error (no charge)"
          }
        }
      },
      "post": {
        "operationId": "geocodePost",
        "summary": "Geocode a place name or address to coordinates, structured address and bounding box",
        "tags": [
          "Geo",
          "Location",
          "Weather",
          "geocode"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "q": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "description": "Place name or address, 1-200 characters, e.g. 'Sunrise, Florida' or '10 Downing Street, London'"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5,
                    "default": 1,
                    "description": "Maximum number of matches to return (1-5, default 1)"
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Za-z]{2}$",
                    "description": "Optional ISO 3166-1 alpha-2 country code to restrict results, e.g. us, gb, de"
                  }
                },
                "required": [
                  "q"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "results": {
                      "type": "array",
                      "minItems": 1,
                      "maxItems": 5,
                      "items": {
                        "type": "object",
                        "properties": {
                          "lat": {
                            "type": "number"
                          },
                          "lon": {
                            "type": "number"
                          },
                          "display_name": {
                            "type": "string",
                            "description": "Full human-readable name from OpenStreetMap"
                          },
                          "type": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "OSM feature type, e.g. city, house, road"
                          },
                          "category": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "OSM feature category, e.g. place, boundary, building"
                          },
                          "importance": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Nominatim relevance score, 0-1"
                          },
                          "address": {
                            "type": "object",
                            "description": "Structured address; any part the map data lacks is null. city falls back to town, village or hamlet.",
                            "properties": {
                              "house_number": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "road": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "city": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "county": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "state": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "postcode": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "country": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "country_code": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Lowercase ISO 3166-1 alpha-2"
                              }
                            },
                            "required": [
                              "house_number",
                              "road",
                              "city",
                              "county",
                              "state",
                              "postcode",
                              "country",
                              "country_code"
                            ]
                          },
                          "bounding_box": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "number"
                            },
                            "minItems": 4,
                            "maxItems": 4,
                            "description": "[south, north, west, east] in decimal degrees"
                          }
                        },
                        "required": [
                          "lat",
                          "lon",
                          "display_name",
                          "type",
                          "category",
                          "importance",
                          "address",
                          "bounding_box"
                        ]
                      },
                      "description": "Best matches first"
                    },
                    "source": {
                      "type": "string"
                    },
                    "attribution": {
                      "type": "string",
                      "description": "Required attribution text; show it wherever the data is displayed"
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "query",
                    "country",
                    "results",
                    "source",
                    "attribution",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "No place matches q (no charge)"
          },
          "413": {
            "description": "Request body too large (no charge)"
          },
          "502": {
            "description": "Data source unreachable, timed out (6 s) or returned an error (no charge)"
          }
        }
      }
    },
    "/reverse": {
      "get": {
        "operationId": "reverse",
        "summary": "Reverse geocode coordinates to the nearest address",
        "tags": [
          "Geo",
          "Location",
          "Weather",
          "reverse"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Latitude in decimal degrees"
          },
          {
            "name": "lon",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Longitude in decimal degrees"
          },
          {
            "name": "zoom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Level of detail: 18 building (default), 17 major/minor streets, 16 street, 14 suburb, 12 town/borough, 10 city, 8 county, 5 state, 3 country"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "lat": {
                      "type": "number",
                      "description": "The requested latitude"
                    },
                    "lon": {
                      "type": "number"
                    },
                    "zoom": {
                      "type": "integer"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "address": {
                      "type": "object",
                      "description": "Structured address; any part the map data lacks is null. city falls back to town, village or hamlet.",
                      "properties": {
                        "house_number": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "road": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "county": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "postcode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country_code": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Lowercase ISO 3166-1 alpha-2"
                        }
                      },
                      "required": [
                        "house_number",
                        "road",
                        "city",
                        "county",
                        "state",
                        "postcode",
                        "country",
                        "country_code"
                      ]
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "category": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "osm_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "osm_id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "source": {
                      "type": "string"
                    },
                    "attribution": {
                      "type": "string",
                      "description": "Required attribution text; show it wherever the data is displayed"
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "lat",
                    "lon",
                    "zoom",
                    "display_name",
                    "address",
                    "type",
                    "category",
                    "source",
                    "attribution",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "No address at these coordinates, e.g. open ocean (no charge)"
          },
          "413": {
            "description": "Request body too large (no charge)"
          },
          "502": {
            "description": "Data source unreachable, timed out (6 s) or returned an error (no charge)"
          }
        }
      },
      "post": {
        "operationId": "reversePost",
        "summary": "Reverse geocode coordinates to the nearest address",
        "tags": [
          "Geo",
          "Location",
          "Weather",
          "reverse"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lat": {
                    "type": "number",
                    "minimum": -90,
                    "maximum": 90,
                    "description": "Latitude in decimal degrees"
                  },
                  "lon": {
                    "type": "number",
                    "minimum": -180,
                    "maximum": 180,
                    "description": "Longitude in decimal degrees"
                  },
                  "zoom": {
                    "type": "integer",
                    "minimum": 3,
                    "maximum": 18,
                    "default": 18,
                    "description": "Level of detail: 18 building (default), 17 major/minor streets, 16 street, 14 suburb, 12 town/borough, 10 city, 8 county, 5 state, 3 country"
                  }
                },
                "required": [
                  "lat",
                  "lon"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "lat": {
                      "type": "number",
                      "description": "The requested latitude"
                    },
                    "lon": {
                      "type": "number"
                    },
                    "zoom": {
                      "type": "integer"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "address": {
                      "type": "object",
                      "description": "Structured address; any part the map data lacks is null. city falls back to town, village or hamlet.",
                      "properties": {
                        "house_number": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "road": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "county": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "postcode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "country_code": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Lowercase ISO 3166-1 alpha-2"
                        }
                      },
                      "required": [
                        "house_number",
                        "road",
                        "city",
                        "county",
                        "state",
                        "postcode",
                        "country",
                        "country_code"
                      ]
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "category": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "osm_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "osm_id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "source": {
                      "type": "string"
                    },
                    "attribution": {
                      "type": "string",
                      "description": "Required attribution text; show it wherever the data is displayed"
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "lat",
                    "lon",
                    "zoom",
                    "display_name",
                    "address",
                    "type",
                    "category",
                    "source",
                    "attribution",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "No address at these coordinates, e.g. open ocean (no charge)"
          },
          "413": {
            "description": "Request body too large (no charge)"
          },
          "502": {
            "description": "Data source unreachable, timed out (6 s) or returned an error (no charge)"
          }
        }
      }
    },
    "/weather": {
      "get": {
        "operationId": "weather",
        "summary": "Current weather and 7-day forecast for coordinates or a place name (metric + imperial)",
        "tags": [
          "Geo",
          "Location",
          "Weather",
          "weather"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Latitude in decimal degrees (together with lon)"
          },
          {
            "name": "lon",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Longitude in decimal degrees (together with lat)"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Instead of lat/lon: a place name or address; geocoded first (top match) and returned as place"
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional ISO country code to restrict the place lookup when using q"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string",
                      "description": "Present when q was used"
                    },
                    "place": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lon": {
                          "type": "number"
                        },
                        "display_name": {
                          "type": "string",
                          "description": "Full human-readable name from OpenStreetMap"
                        },
                        "type": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "OSM feature type, e.g. city, house, road"
                        },
                        "category": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "OSM feature category, e.g. place, boundary, building"
                        },
                        "importance": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Nominatim relevance score, 0-1"
                        },
                        "address": {
                          "type": "object",
                          "description": "Structured address; any part the map data lacks is null. city falls back to town, village or hamlet.",
                          "properties": {
                            "house_number": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "road": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "city": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "county": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "state": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "postcode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "country": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "country_code": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Lowercase ISO 3166-1 alpha-2"
                            }
                          },
                          "required": [
                            "house_number",
                            "road",
                            "city",
                            "county",
                            "state",
                            "postcode",
                            "country",
                            "country_code"
                          ]
                        },
                        "bounding_box": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "number"
                          },
                          "minItems": 4,
                          "maxItems": 4,
                          "description": "[south, north, west, east] in decimal degrees"
                        }
                      },
                      "required": [
                        "lat",
                        "lon",
                        "display_name",
                        "type",
                        "category",
                        "importance",
                        "address",
                        "bounding_box"
                      ],
                      "description": "The geocoded place, present when q was used"
                    },
                    "lat": {
                      "type": "number"
                    },
                    "lon": {
                      "type": "number"
                    },
                    "timezone": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "IANA time zone of the location"
                    },
                    "timezone_abbreviation": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "utc_offset_seconds": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "local_time": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Local time of the current observation, ISO 8601 without offset"
                    },
                    "current": {
                      "type": "object",
                      "properties": {
                        "temperature_c": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "temperature_f": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "feels_like_c": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "feels_like_f": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "humidity_pct": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "precipitation_mm": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wind_kph": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wind_mph": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wind_direction_deg": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "condition": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "weather_code": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "temperature_c",
                        "temperature_f",
                        "feels_like_c",
                        "feels_like_f",
                        "humidity_pct",
                        "precipitation_mm",
                        "wind_kph",
                        "wind_mph",
                        "wind_direction_deg",
                        "condition",
                        "weather_code"
                      ]
                    },
                    "daily": {
                      "type": "array",
                      "minItems": 1,
                      "maxItems": 7,
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "description": "Local date YYYY-MM-DD"
                          },
                          "condition": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Plain-text weather from the WMO code"
                          },
                          "weather_code": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "WMO weather interpretation code"
                          },
                          "high_c": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "high_f": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "low_c": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "low_f": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "precipitation_mm": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "precipitation_probability_pct": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "sunrise": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Local time, ISO 8601 without offset"
                          },
                          "sunset": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "date",
                          "condition",
                          "weather_code",
                          "high_c",
                          "high_f",
                          "low_c",
                          "low_f",
                          "precipitation_mm",
                          "precipitation_probability_pct",
                          "sunrise",
                          "sunset"
                        ]
                      },
                      "description": "Today plus the next 6 days"
                    },
                    "source": {
                      "type": "string"
                    },
                    "attribution": {
                      "type": "string",
                      "description": "Required attribution text; show it wherever the data is displayed"
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "lat",
                    "lon",
                    "timezone",
                    "timezone_abbreviation",
                    "utc_offset_seconds",
                    "local_time",
                    "current",
                    "daily",
                    "source",
                    "attribution",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "q could not be geocoded (no charge)"
          },
          "413": {
            "description": "Request body too large (no charge)"
          },
          "502": {
            "description": "Data source unreachable, timed out (6 s) or returned an error (no charge)"
          }
        }
      },
      "post": {
        "operationId": "weatherPost",
        "summary": "Current weather and 7-day forecast for coordinates or a place name (metric + imperial)",
        "tags": [
          "Geo",
          "Location",
          "Weather",
          "weather"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lat": {
                    "type": "number",
                    "minimum": -90,
                    "maximum": 90,
                    "description": "Latitude in decimal degrees (together with lon)"
                  },
                  "lon": {
                    "type": "number",
                    "minimum": -180,
                    "maximum": 180,
                    "description": "Longitude in decimal degrees (together with lat)"
                  },
                  "q": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "description": "Instead of lat/lon: a place name or address; geocoded first (top match) and returned as place"
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Za-z]{2}$",
                    "description": "Optional ISO country code to restrict the place lookup when using q"
                  }
                },
                "description": "Either lat and lon, or q"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string",
                      "description": "Present when q was used"
                    },
                    "place": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lon": {
                          "type": "number"
                        },
                        "display_name": {
                          "type": "string",
                          "description": "Full human-readable name from OpenStreetMap"
                        },
                        "type": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "OSM feature type, e.g. city, house, road"
                        },
                        "category": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "OSM feature category, e.g. place, boundary, building"
                        },
                        "importance": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Nominatim relevance score, 0-1"
                        },
                        "address": {
                          "type": "object",
                          "description": "Structured address; any part the map data lacks is null. city falls back to town, village or hamlet.",
                          "properties": {
                            "house_number": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "road": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "city": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "county": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "state": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "postcode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "country": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "country_code": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Lowercase ISO 3166-1 alpha-2"
                            }
                          },
                          "required": [
                            "house_number",
                            "road",
                            "city",
                            "county",
                            "state",
                            "postcode",
                            "country",
                            "country_code"
                          ]
                        },
                        "bounding_box": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "number"
                          },
                          "minItems": 4,
                          "maxItems": 4,
                          "description": "[south, north, west, east] in decimal degrees"
                        }
                      },
                      "required": [
                        "lat",
                        "lon",
                        "display_name",
                        "type",
                        "category",
                        "importance",
                        "address",
                        "bounding_box"
                      ],
                      "description": "The geocoded place, present when q was used"
                    },
                    "lat": {
                      "type": "number"
                    },
                    "lon": {
                      "type": "number"
                    },
                    "timezone": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "IANA time zone of the location"
                    },
                    "timezone_abbreviation": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "utc_offset_seconds": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "local_time": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Local time of the current observation, ISO 8601 without offset"
                    },
                    "current": {
                      "type": "object",
                      "properties": {
                        "temperature_c": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "temperature_f": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "feels_like_c": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "feels_like_f": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "humidity_pct": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "precipitation_mm": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wind_kph": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wind_mph": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "wind_direction_deg": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "condition": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "weather_code": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "temperature_c",
                        "temperature_f",
                        "feels_like_c",
                        "feels_like_f",
                        "humidity_pct",
                        "precipitation_mm",
                        "wind_kph",
                        "wind_mph",
                        "wind_direction_deg",
                        "condition",
                        "weather_code"
                      ]
                    },
                    "daily": {
                      "type": "array",
                      "minItems": 1,
                      "maxItems": 7,
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "description": "Local date YYYY-MM-DD"
                          },
                          "condition": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Plain-text weather from the WMO code"
                          },
                          "weather_code": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "WMO weather interpretation code"
                          },
                          "high_c": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "high_f": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "low_c": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "low_f": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "precipitation_mm": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "precipitation_probability_pct": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "sunrise": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Local time, ISO 8601 without offset"
                          },
                          "sunset": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "date",
                          "condition",
                          "weather_code",
                          "high_c",
                          "high_f",
                          "low_c",
                          "low_f",
                          "precipitation_mm",
                          "precipitation_probability_pct",
                          "sunrise",
                          "sunset"
                        ]
                      },
                      "description": "Today plus the next 6 days"
                    },
                    "source": {
                      "type": "string"
                    },
                    "attribution": {
                      "type": "string",
                      "description": "Required attribution text; show it wherever the data is displayed"
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "lat",
                    "lon",
                    "timezone",
                    "timezone_abbreviation",
                    "utc_offset_seconds",
                    "local_time",
                    "current",
                    "daily",
                    "source",
                    "attribution",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "q could not be geocoded (no charge)"
          },
          "413": {
            "description": "Request body too large (no charge)"
          },
          "502": {
            "description": "Data source unreachable, timed out (6 s) or returned an error (no charge)"
          }
        }
      }
    }
  }
}