{
  "openapi": "3.1.0",
  "info": {
    "title": "Habercy Public API",
    "version": "1.0.0",
    "summary": "Habercy haber, ekonomi, spor ve astroloji verilerine salt okunur erişim.",
    "description": "Habercy (habercy.com) herkese açık, salt okunur bir JSON API sunar.\n\n- **Kimlik doğrulama gerekmez.** API anahtarı, OAuth veya token yok.\n- **Ücretsizdir.** Ödeme planı yok (bkz. `/pricing.md`).\n- **Hız sınırı:** IP başına ~60 istek/dakika. Aşımda `429` ve `Retry-After` döner;\n  yanıtlarda `RateLimit-Limit` / `RateLimit-Remaining` / `RateLimit-Reset` başlıkları bulunur.\n- **Hatalar** RFC 9457 `application/problem+json` biçimindedir.\n\nAraç çağrısıyla (tool calling) erişmek istiyorsanız aynı verileri sunan bir\nMCP sunucusu da var: `https://habercy.com/mcp`.\n\nİçeriği kullanırken haberin kalıcı adresine bağlantı verin. Ayrıntılı kurallar:\n`https://habercy.com/AGENTS.md`.",
    "contact": {
      "name": "Habercy yayın birimi",
      "email": "iletisim@habercy.com",
      "url": "https://habercy.com/iletisim"
    },
    "license": {
      "name": "Kullanım koşulları",
      "url": "https://habercy.com/kullanim-kosullari"
    },
    "termsOfService": "https://habercy.com/kullanim-kosullari"
  },
  "externalDocs": {
    "description": "Geliştirici ve ajan belgeleri",
    "url": "https://habercy.com/gelistirici"
  },
  "servers": [
    {
      "url": "https://api.habercy.com",
      "description": "Üretim"
    }
  ],
  "tags": [
    {
      "name": "Haberler",
      "description": "Yayınlanmış haber içeriği"
    },
    {
      "name": "Ekonomi",
      "description": "Döviz, altın, kripto ve makro göstergeler"
    },
    {
      "name": "Spor",
      "description": "Canlı skorlar, puan durumu, fikstür"
    },
    {
      "name": "Astroloji",
      "description": "Günlük gökyüzü haritası ve burç yorumları"
    },
    {
      "name": "Site",
      "description": "Sayfa çerçevesi verileri"
    }
  ],
  "paths": {
    "/api/public/home": {
      "get": {
        "operationId": "getHomeFeed",
        "tags": [
          "Haberler"
        ],
        "summary": "Ana sayfa akışının tamamı",
        "description": "Manşet, son dakika, kategori bölümleri ve menü/footer kategori listeleri tek çağrıda döner. Sitenin tamamını gezmek yerine buradan başlayın.",
        "responses": {
          "200": {
            "description": "Ana sayfa akışı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/news/{slug}": {
      "get": {
        "operationId": "getArticle",
        "tags": [
          "Haberler"
        ],
        "summary": "Tek haberin tam metni",
        "description": "Haberin başlığı, özeti, HTML gövdesi, görsel künyesi ve aynı kategoriden ilgili haberler. `slug` değerlerini `/api/public/slugs` ya da site haritasından alabilirsiniz.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Haberin URL kimliği (habercy.com/haber/<slug>).",
            "schema": {
              "type": "string"
            },
            "example": "galatasaray-goztepe-yi-3-2-yenerek-liderlige-yukseldi"
          }
        ],
        "responses": {
          "200": {
            "description": "Haber detayı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Haber bulunamadı veya yayında değil",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/categories/{slug}": {
      "get": {
        "operationId": "getCategory",
        "tags": [
          "Haberler"
        ],
        "summary": "Kategorinin sayfalanmış haber listesi",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "ekonomi"
          },
          {
            "name": "page",
            "in": "query",
            "description": "1’den başlar. Sayfa başına 18 haber.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Kategori listesi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Kategori bulunamadı",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/search": {
      "get": {
        "operationId": "searchNews",
        "tags": [
          "Haberler"
        ],
        "summary": "Haber araması",
        "description": "Başlık ve özet üzerinde metin araması. Boş sorgu boş sonuç döndürür (hata değil).",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Aranacak metin (en fazla 120 karakter).",
            "schema": {
              "type": "string",
              "maxLength": 120
            },
            "example": "enflasyon"
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Arama sonuçları",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/slugs": {
      "get": {
        "operationId": "listArticleSlugs",
        "tags": [
          "Haberler"
        ],
        "summary": "Yayınlanmış tüm haberlerin kimlik ve başlıkları",
        "description": "En yeniden eskiye, en fazla 5.000 kayıt. Toplu içe aktarma ve site haritası üretimi için.",
        "responses": {
          "200": {
            "description": "Slug listesi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": [
                  {
                    "slug": "ornek-haber-basligi",
                    "title": "Örnek haber başlığı",
                    "publishedAt": "2026-08-29T09:12:00.000Z",
                    "category": "Ekonomi"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/api/public/chrome": {
      "get": {
        "operationId": "getSiteChrome",
        "tags": [
          "Site"
        ],
        "summary": "Üst bar verileri (tarih, hava durumu, döviz)",
        "responses": {
          "200": {
            "description": "Çerçeve verisi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/markets": {
      "get": {
        "operationId": "getMarketsOverview",
        "tags": [
          "Ekonomi"
        ],
        "summary": "Tüm anlık piyasa değerleri ve makro göstergeler",
        "description": "Döviz kurları (TCMB), altın, kripto ve TCMB EVDS makro serileri. Değerler sunucuda önbelleklenir ve gecikmeli olabilir; her kalemin kaynağı yanıtta yazar.",
        "responses": {
          "200": {
            "description": "Piyasa görünümü",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/markets/instruments": {
      "get": {
        "operationId": "listInstruments",
        "tags": [
          "Ekonomi"
        ],
        "summary": "Grafiği çizilebilen enstrümanların listesi",
        "responses": {
          "200": {
            "description": "Enstrüman listesi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/markets/series/{id}": {
      "get": {
        "operationId": "getInstrumentSeries",
        "tags": [
          "Ekonomi"
        ],
        "summary": "Tek enstrümanın zaman serisi",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "`/api/public/markets/instruments` içindeki kimlik.",
            "schema": {
              "type": "string"
            },
            "example": "usd-try"
          },
          {
            "name": "range",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1a",
                "3a",
                "6a",
                "1y",
                "5y"
              ],
              "default": "1y"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Zaman serisi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz aralık",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Enstrüman tanınmıyor veya veri alınamadı",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/sports": {
      "get": {
        "operationId": "getSportsOverview",
        "tags": [
          "Spor"
        ],
        "summary": "Canlı maçlar, günün programı ve Süper Lig tablosu",
        "responses": {
          "200": {
            "description": "Spor görünümü",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/sports/leagues": {
      "get": {
        "operationId": "listLeagues",
        "tags": [
          "Spor"
        ],
        "summary": "Takip edilen ligler",
        "responses": {
          "200": {
            "description": "Lig listesi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/sports/live": {
      "get": {
        "operationId": "getLiveMatches",
        "tags": [
          "Spor"
        ],
        "summary": "Yalnızca canlı maçlar",
        "description": "Küçük yanıt; sık yoklamaya uygundur (60 saniyeden sık istemeyin).",
        "responses": {
          "200": {
            "description": "Canlı maçlar",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/sports/standings/{leagueId}": {
      "get": {
        "operationId": "getStandings",
        "tags": [
          "Spor"
        ],
        "summary": "Ligin puan durumu",
        "parameters": [
          {
            "name": "leagueId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "super-lig"
          }
        ],
        "responses": {
          "200": {
            "description": "Puan durumu",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Bilinmeyen lig veya veri alınamadı",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/sports/fixtures/{leagueId}": {
      "get": {
        "operationId": "getFixtures",
        "tags": [
          "Spor"
        ],
        "summary": "Ligin fikstürü",
        "parameters": [
          {
            "name": "leagueId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "super-lig"
          }
        ],
        "responses": {
          "200": {
            "description": "Fikstür",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Bilinmeyen lig veya veri alınamadı",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/astrology": {
      "get": {
        "operationId": "getDailyHoroscope",
        "tags": [
          "Astroloji"
        ],
        "summary": "Günün gökyüzü haritası ve 12 burç yorumu",
        "description": "Gezegen konumları ve açılar gerçek efemeritten HESAPLANIR; yorum metni bu hesaplanmış haritadan yazılır. Yani \"Merkür retro\" gibi ifadeler doğrulanabilir birer iddiadır.",
        "parameters": [
          {
            "name": "tarih",
            "in": "query",
            "description": "YYYY-AA-GG. Verilmezse bugün.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Günlük astroloji paketi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/astrology/burc/{slug}": {
      "get": {
        "operationId": "getSignHoroscope",
        "tags": [
          "Astroloji"
        ],
        "summary": "Tek burcun günlük yorumu",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "koc",
                "boga",
                "ikizler",
                "yengec",
                "aslan",
                "basak",
                "terazi",
                "akrep",
                "yay",
                "oglak",
                "kova",
                "balik"
              ]
            },
            "example": "koc"
          },
          {
            "name": "tarih",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Burç yorumu",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Bilinmeyen burç",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/astrology/arsiv": {
      "get": {
        "operationId": "listHoroscopeArchive",
        "tags": [
          "Astroloji"
        ],
        "summary": "Son günlerin astroloji arşivi",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Arşiv listesi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 (problem+json) hata gövdesi.",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "Hata türünün adresi."
          },
          "title": {
            "type": "string",
            "description": "Kısa, insan okur açıklama."
          },
          "status": {
            "type": "integer",
            "description": "HTTP durum kodu."
          },
          "detail": {
            "type": "string",
            "description": "Bu olaya özgü ayrıntı."
          },
          "instance": {
            "type": "string",
            "description": "Hatanın oluştuğu yol."
          }
        },
        "required": [
          "type",
          "title",
          "status"
        ]
      }
    }
  },
  "security": []
}