{
  "openapi": "3.1.0",
  "info": {
    "title": "Pointmoon public facts API",
    "version": "2.0.0",
    "description": "Read-only current place conditions. This specification covers the public facts entry point, not private Studio APIs. Free for non-commercial use; commercial use requires a paid plan by request. Coverage varies; inspect evidence and freshness before making claims.",
    "termsOfService": "https://pointmoon.ai/terms",
    "contact": {
      "url": "https://pointmoon.ai/support"
    }
  },
  "servers": [
    {
      "url": "https://pointmoon.ai"
    }
  ],
  "security": [],
  "externalDocs": {
    "description": "HTTP guide and MCP setup",
    "url": "https://pointmoon.ai/docs"
  },
  "paths": {
    "/api/moon": {
      "get": {
        "operationId": "readPlaceFacts",
        "summary": "Read conditions at a place",
        "description": "Supply both lat and lng, or a place name. Coordinates take precedence. Use audience=facts and surface=open for the public structured response. Missing or uncertain source data may be unresolved within a successful response.",
        "parameters": [
          {
            "name": "audience",
            "in": "query",
            "required": true,
            "description": "Select the structured facts response.",
            "schema": {
              "type": "string",
              "enum": [
                "facts"
              ]
            }
          },
          {
            "name": "surface",
            "in": "query",
            "required": true,
            "description": "Select the public surface with redistributable observations.",
            "schema": {
              "type": "string",
              "enum": [
                "open"
              ]
            }
          },
          {
            "name": "lat",
            "in": "query",
            "required": false,
            "description": "Latitude in decimal degrees; pair with lng.",
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90,
              "examples": [
                42.36
              ]
            }
          },
          {
            "name": "lng",
            "in": "query",
            "required": false,
            "description": "Longitude in decimal degrees; pair with lat.",
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180,
              "examples": [
                -71.06
              ]
            }
          },
          {
            "name": "place",
            "in": "query",
            "required": false,
            "description": "A place name used when coordinates are not supplied.",
            "schema": {
              "type": "string",
              "examples": [
                "Boston"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured facts. Optional source readings can be missing, null or unresolved; a successful response does not imply every source answered. The schema below is an extensible envelope, not a complete inventory of readings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FactsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request. Inspect the JSON error message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Fair-use rate limit reached. Respect Retry-After before retrying.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Delay before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request could not be completed. Retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "FactsResponse": {
        "type": "object",
        "required": [
          "schemaVersion",
          "facts"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string"
          },
          "facts": {
            "type": "object",
            "properties": {
              "signals": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "fieldSnapshot": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": true
              }
            },
            "additionalProperties": true
          },
          "provenance": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        },
        "additionalProperties": true
      }
    }
  }
}
