{
  "openapi": "3.1.1",
  "info": {
    "title": "Skyfold Satellite Pass Predictor API",
    "version": "1.0.0",
    "summary": "When the ISS or any satellite flies over you, and whether you can see it, from TLE elements.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://skyfoldsatellitepasses.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "When the ISS or any satellite flies over you, and whether you can see it, from TLE elements.",
        "description": "Predicts rise, culmination and set of satellites over a place with an SGP4/SDP4 propagator verified against the published Vallado test cases, and marks the naked-eye visible part (satellite in sunlight, sky dark). Paste elements or fetch them from CelesTrak.\n\nMethodology:\n- SGP4/SDP4 after Hoots \u0026 Roehrich (Spacetrack Report #3) as revised by Vallado, Crawford, Hujsak and Kelso (AIAA 2006-6753), WGS-72 constants, AFSPC mode; matches the published verification ephemerides to better than 1 m.\n- TEME positions are rotated to the Earth-fixed frame with Greenwich mean sidereal time; look angles for a WGS84 observer.\n- Passes: elevation sampled every 20–60 s, crossings refined by bisection to 0.5 s, culmination by golden-section search.\n- Visible = satellite at least half sunlit (conical Earth shadow) while the Sun is 6° or more below the observer’s horizon.\n- CelesTrak elements are cached for 2 hours per request, as CelesTrak asks.\n\nTLE predictions degrade with element age (minutes after a week or two); reboosts of the ISS shift passes. Brightness (magnitude) is not predicted.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "skyfold_satellite_passes",
        "x-owner-app": "skyfold",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkyfoldSatellitePassesInput"
              },
              "examples": {
                "example1": {
                  "summary": "ISS over Utrecht (elements of 7 November 2026)",
                  "value": {
                    "location": "52.0907, 5.1214",
                    "timeZone": "Europe/Amsterdam",
                    "date": "2026-11-07",
                    "time": "18:00",
                    "source": "paste",
                    "tle": "ISS (ZARYA)\n1 25544U 98067A   26311.20783432  .00014294  00000+0  26479-3 0  9992\n2 25544  51.6321 312.3516 0007247 357.8301   2.2655 15.49235271593925",
                    "days": 2,
                    "minElevation": 10,
                    "visibleOnly": false
                  }
                },
                "example2": {
                  "summary": "ISS from Madrid, three days",
                  "value": {
                    "location": "40.4168, -3.7038",
                    "timeZone": "Europe/Madrid",
                    "date": "2026-11-08",
                    "time": "00:00",
                    "source": "paste",
                    "tle": "ISS (ZARYA)\n1 25544U 98067A   26311.20783432  .00014294  00000+0  26479-3 0  9992\n2 25544  51.6321 312.3516 0007247 357.8301   2.2655 15.49235271593925",
                    "days": 3,
                    "minElevation": 15,
                    "visibleOnly": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkyfoldSatellitePassesResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "SkyfoldSatellitePassesInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "location": {
            "title": "Location (latitude, longitude)",
            "description": "Decimal degrees such as 52.09, 5.12 (north and east positive), or DMS, UTM, MGRS, Maidenhead or a plus code.",
            "type": "string",
            "maxLength": 80,
            "default": "52.0907, 5.1214"
          },
          "elevation": {
            "title": "Elevation above sea level",
            "type": "number",
            "minimum": -500,
            "maximum": 9000,
            "default": 0,
            "x-unit": "m"
          },
          "timeZone": {
            "title": "Time zone",
            "description": "IANA name such as Europe/Berlin or America/New_York, or a fixed offset such as UTC+2.",
            "type": "string",
            "maxLength": 64,
            "default": "Europe/Amsterdam"
          },
          "date": {
            "title": "Local date",
            "type": "string",
            "format": "date",
            "default": "2026-11-07"
          },
          "time": {
            "title": "Local time",
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
            "default": "18:00"
          },
          "source": {
            "title": "Elements",
            "type": "string",
            "enum": [
              "paste",
              "celestrak"
            ],
            "default": "paste"
          },
          "tle": {
            "title": "Two-line elements (TLE)",
            "description": "One or more sets: an optional name line, then line 1 and line 2.",
            "type": "string",
            "maxLength": 60000,
            "default": "ISS (ZARYA)\n1 25544U 98067A   26311.20783432  .00014294  00000+0  26479-3 0  9992\n2 25544  51.6321 312.3516 0007247 357.8301   2.2655 15.49235271593925"
          },
          "catalogNumbers": {
            "title": "NORAD catalogue numbers (CelesTrak)",
            "description": "Up to 5 numbers separated by commas, for example 25544 for the ISS. Used when Elements is set to CelesTrak.",
            "type": "string",
            "maxLength": 60,
            "default": "25544"
          },
          "group": {
            "title": "Or a CelesTrak group",
            "type": "string",
            "enum": [
              "",
              "stations",
              "visual",
              "amateur",
              "weather",
              "science"
            ],
            "default": ""
          },
          "days": {
            "title": "Days to search",
            "type": "number",
            "minimum": 0.25,
            "maximum": 7,
            "default": 2
          },
          "minElevation": {
            "title": "Minimum elevation",
            "type": "number",
            "minimum": 0,
            "maximum": 80,
            "default": 10,
            "x-unit": "°"
          },
          "visibleOnly": {
            "title": "Only naked-eye visible passes",
            "type": "boolean",
            "default": false
          }
        },
        "required": []
      },
      "SkyfoldSatellitePassesResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object"
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}