{
  "openapi": "3.1.0",
  "info": {
    "title": "Dış Gündem halka açık okuma API'si",
    "version": "1.0.0",
    "description": "Mevcut ziyaretçi nabız API'si. Üye/Pro projeksiyonları burada açılmaz. MCP yönetimi ayrı protokoldür."
  },
  "servers": [
    {
      "url": "https://disgundem.com"
    }
  ],
  "paths": {
    "/api/nabiz": {
      "get": {
        "operationId": "getPublicCountryPulse",
        "summary": "Ziyaretçi gündem nabzı",
        "security": [],
        "description": "Yedi günlük başlıksız ziyaretçi projeksiyonu. Desteklenen ülkeler yanıttaki available alanındadır. onizleme=1 yalnız başlıksız 30 günlük şekilleri ekler.",
        "parameters": [
          {
            "name": "ulke",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "gr",
                "il",
                "gb"
              ]
            },
            "example": "gr",
            "description": "Desteklenen ülke kodu; verilmezse mevcut API'nin ilk ülkesi kullanılır."
          },
          {
            "name": "onizleme",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1",
            "description": "Yalnız 1 değeri başlıksız önizlemeyi açar; diğer değerler açmaz."
          }
        ],
        "responses": {
          "200": {
            "description": "Başlıksız ziyaretçi verisi",
            "content": {
              "application/json": {
                "example": {
                  "ok": true,
                  "available": [
                    {
                      "id": "gr",
                      "name": "Yunanistan"
                    }
                  ],
                  "countryId": "gr",
                  "countryName": "Yunanistan",
                  "tier": "visitor",
                  "days": 7,
                  "maxDays": 30,
                  "titles": false,
                  "dates": [
                    "2026-09-26",
                    "2026-09-27",
                    "2026-09-28",
                    "2026-09-29",
                    "2026-09-30",
                    "2026-10-01",
                    "2026-10-02"
                  ],
                  "threads": [],
                  "singles": [
                    {
                      "day": 0,
                      "count": 0
                    },
                    {
                      "day": 1,
                      "count": 0
                    },
                    {
                      "day": 2,
                      "count": 0
                    },
                    {
                      "day": 3,
                      "count": 0
                    },
                    {
                      "day": 4,
                      "count": 0
                    },
                    {
                      "day": 5,
                      "count": 0
                    },
                    {
                      "day": 6,
                      "count": 0
                    }
                  ],
                  "daily": [
                    {
                      "dateId": "2026-09-26",
                      "published": false,
                      "stories": 0,
                      "categories": {}
                    },
                    {
                      "dateId": "2026-09-27",
                      "published": false,
                      "stories": 0,
                      "categories": {}
                    },
                    {
                      "dateId": "2026-09-28",
                      "published": false,
                      "stories": 0,
                      "categories": {}
                    },
                    {
                      "dateId": "2026-09-29",
                      "published": false,
                      "stories": 0,
                      "categories": {}
                    },
                    {
                      "dateId": "2026-09-30",
                      "published": false,
                      "stories": 0,
                      "categories": {}
                    },
                    {
                      "dateId": "2026-10-01",
                      "published": false,
                      "stories": 0,
                      "categories": {}
                    },
                    {
                      "dateId": "2026-10-02",
                      "published": true,
                      "stories": 0,
                      "categories": {}
                    }
                  ],
                  "insights": {},
                  "totalStories": 0,
                  "categoryTotals": {},
                  "preview": null
                },
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "available",
                    "countryId",
                    "tier",
                    "titles",
                    "days",
                    "threads",
                    "preview"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "available": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      }
                    },
                    "countryId": {
                      "type": "string"
                    },
                    "countryName": {
                      "type": "string"
                    },
                    "tier": {
                      "const": "visitor"
                    },
                    "titles": {
                      "const": false
                    },
                    "days": {
                      "type": "integer"
                    },
                    "dates": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "singles": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "preview": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Ülke desteklenmiyor veya yayımlanmış veri yok",
            "content": {
              "application/json": {
                "example": {
                  "ok": false,
                  "error": "Bu ülke için gündem nabzı henüz yayında değil."
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "GET dışında yöntem: mevcut düz metin method yanıtı",
            "content": {
              "text/plain": {
                "example": "method",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Geçici sunucu hatası",
            "content": {
              "application/json": {
                "example": {
                  "ok": false,
                  "error": "hata"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "string"
          }
        }
      }
    }
  },
  "externalDocs": {
    "url": "https://disgundem.com/api/docs",
    "description": "Kamu erişimi, formatlar ve MCP yetkilendirme sınırları"
  }
}
