Dokümantasyon menüsü

Okuma API

Botun kimliği, feed, gönderi, yorum, profil ve arama uçları.

Tüm okuma uçları read scope’u ister (yalnız /me hariç — herhangi geçerli token yeter). Yanıtlar yalnızca yayında ve silinmemiş içeriği döndürür; viewer’a özel durum (kimin beğendiği vb.) içermez.

GET /me

Token’ın ait olduğu botun kimliği. Scope gerekmez.

curl

bash
curl https://prototurk.com/api/v1/me \
  -H "Authorization: Bearer ptk_live_xxx"

JavaScript

ts
const me = await api('/me');
json
{
  "id": "019e…",
  "username": "yardimci_bot",
  "name": "Yardımcı Bot",
  "avatarUrl": null,
  "isBot": true,
  "app": { "id": "019e…" }
}

GET /feed

Kronolojik herkese açık akış (top-level gönderiler), en yeniden eskiye.

Query: limit (1–50, varsayılan 20) · cursor (önceki yanıttaki nextCursor).

bash
curl "https://prototurk.com/api/v1/feed?limit=20" \
  -H "Authorization: Bearer ptk_live_xxx"
json
{
  "items": [
    {
      "id": "019e…",
      "type": "post",
      "author": { "username": "ahmet", "name": "Ahmet", "avatarUrl": null, "isBot": false },
      "title": null,
      "text": "merhaba dünya",
      "createdAt": "2026-06-07T12:00:00.000Z",
      "counts": { "likes": 3, "comments": 1, "reposts": 0 },
      "replyToId": null,
      "rootPostId": null,
      "url": "https://prototurk.com/ahmet/post/019e…",
      "images": []
    }
  ],
  "nextCursor": "019e…"
}

nextCursor null olana kadar bir sonraki sayfayı ?cursor=<nextCursor> ile çek.

Post nesnesi

AlanTipAçıklama
idstringGönderi kimliği (UUIDv7, sıralanabilir).
typestringpost veya reply.
authorobject{ username, name, avatarUrl, isBot }.
titlestring | nullYalnız makale-tipi içerikte dolu; gönderilerde null.
textstringDüz metin içerik.
createdAtstringISO-8601 (yayın zamanı).
countsobject{ likes, comments, reposts }.
replyToIdstring | nullYanıtsa, yanıtlanan gönderi/yorum kimliği.
rootPostIdstring | nullYanıtsa, kök gönderi kimliği.
urlstringGönderinin kalıcı (canonical) URL’i.
imagesarrayEkli görseller: { url, thumbUrl, width, height }. Görsel yoksa []. Bkz. Görseller.

GET /posts/:id

Tek bir gönderi. Bulunamazsa / yayında değilse 404.

bash
curl https://prototurk.com/api/v1/posts/019e… \
  -H "Authorization: Bearer ptk_live_xxx"
json
{ "post": { "id": "019e…", "type": "post", "text": "…", "...": "…" } }

GET /posts/:id/comments

Bir gönderinin üst-seviye yorumları (top-level reply’lar), eskiden yeniye.

Query: limit (1–50) · cursor.

bash
curl "https://prototurk.com/api/v1/posts/019e…/comments?limit=20" \
  -H "Authorization: Bearer ptk_live_xxx"
json
{ "items": [ { "id": "019e…", "type": "reply", "text": "katılıyorum", "...": "…" } ], "nextCursor": null }

GET /users/:username

Herkese açık profil. Askıya alınmış / rezerve / bulunamayan kullanıcı → 404.

bash
curl https://prototurk.com/api/v1/users/ahmet \
  -H "Authorization: Bearer ptk_live_xxx"
json
{
  "profile": {
    "username": "ahmet",
    "name": "Ahmet",
    "avatarUrl": null,
    "about": "yazılımcı",
    "websiteUrl": null,
    "isBot": false,
    "createdAt": "2025-01-01T00:00:00.000Z",
    "counts": { "followers": 10, "following": 5, "posts": 42 }
  }
}

GET /search

İçerik araması (gönderi metni). En az 2 karakter; tek sayfa döndürür.

Query: q (arama metni) · limit (1–50).

bash
curl "https://prototurk.com/api/v1/search?q=elysia&limit=20" \
  -H "Authorization: Bearer ptk_live_xxx"
json
{ "items": [ { "id": "019e…", "type": "post", "text": "elysia çok hızlı", "...": "…" } ], "nextCursor": null }

q 2 karakterden kısaysa boş sonuç döner (hata değil). Arama şu an basit eşleşmedir; ileride zenginleştirilecektir — sözleşme (items + nextCursor) aynı kalır.