{
  "openapi": "3.0.3",
  "info": {
    "title": "PipAtlas public API",
    "version": "6.02",
    "description": "Free, keyless JSON access to PipAtlas data. Fair use: ~20 requests/minute per IP across all API routes; cache responses (the calendar changes every few minutes). Personal, educational, non-commercial use; no SLA; nothing here is investment advice and it must not feed automated or signal trading.",
    "license": {
      "name": "Educational fair use",
      "url": "https://pipatlas.com/terms.html"
    }
  },
  "servers": [
    {
      "url": "https://pipatlas.com"
    }
  ],
  "paths": {
    "/api/calendar": {
      "get": {
        "summary": "This week's economic calendar (actuals merged in)",
        "tags": [
          "calendar"
        ],
        "responses": {
          "200": {
            "description": "Weekly events with forecast/previous and official actuals where published",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updated": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "stale": {
                      "type": "boolean",
                      "description": "true when upstream is down and a saved copy is served"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "impact": {
                            "type": "string",
                            "enum": [
                              "High",
                              "Medium",
                              "Low",
                              "Holiday"
                            ]
                          },
                          "date": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "forecast": {
                            "type": "string"
                          },
                          "previous": {
                            "type": "string"
                          },
                          "actual": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (~20 req/min/IP)"
          },
          "502": {
            "description": "Upstream failed and no saved copy exists"
          }
        }
      }
    },
    "/api/rates": {
      "get": {
        "summary": "Consolidated reference rates (ECB daily FX, metals, crypto)",
        "tags": [
          "rates"
        ],
        "responses": {
          "200": {
            "description": "Cached 30 min; partial results cached 3 min"
          },
          "502": {
            "description": "All upstream feeds failed"
          }
        }
      }
    },
    "/rss/high-impact-events.xml": {
      "get": {
        "summary": "Upcoming high-impact events as RSS 2.0",
        "tags": [
          "calendar"
        ],
        "responses": {
          "200": {
            "description": "RSS XML, cached 5 min"
          }
        }
      }
    },
    "/healthz": {
      "get": {
        "summary": "Feed health (ages, counts, version)",
        "tags": [
          "system"
        ],
        "responses": {
          "200": {
            "description": "JSON health snapshot"
          }
        }
      }
    },
    "/sitemap.xml": {
      "get": {
        "summary": "Live sitemap of all public pages",
        "tags": [
          "system"
        ],
        "responses": {
          "200": {
            "description": "XML"
          }
        }
      }
    },
    "/VERSION": {
      "get": {
        "summary": "Deployed site version (plain text)",
        "tags": [
          "system"
        ],
        "responses": {
          "200": {
            "description": "e.g. 6.02"
          }
        }
      }
    }
  }
}