API สำหรับนักพัฒนา Developer API

ข้อมูลเพลงไทยแบบอ่านอย่างเดียว เป็น JSON — ต้องมี API key ติดต่อขอได้ที่ [email protected] Read-only JSON data on Thai music releases. An API key is required — email us to get one.

การยืนยันตัวตน Authentication

curl -H "Authorization: Bearer tmt_…" \
  "https://thaimusictimeline.com/api/v1/search?q=bird"

ส่ง key ใน header เท่านั้น ห้ามใส่ใน URL หรือโค้ดฝั่งเบราว์เซอร์ Send the key in a header only — never in URLs or browser code.

Endpoint Endpoints

  • GET /api/v1/search?q={query}&limit={1-20}ค้นหาเพลงและศิลปิน Search songs and artists
  • GET /api/v1/songs/{slug}ข้อมูลเพลง Song details
  • GET /api/v1/artists/{slug}ศิลปิน + ผลงานตามเวลา Artist and works in time order
  • GET /api/v1/labels/{slug}ค่ายเพลง + ผลงาน Label and its songs
  • GET /api/v1/years/{yyyy}เพลงทั้งปี (ค.ศ. หรือ พ.ศ.) Songs of a year (CE or BE)

slug คือส่วนท้ายของ URL หน้าเว็บ เช่น /song/{slug} หรือได้จากผลค้นหา A slug is the last part of the page URL, or comes from search results.

รูปแบบข้อมูล Response format

{
  "data": {
    "slug": "…",
    "title_th": "…",
    "title_en": null,
    "release": { "date": "1995-06", "precision": "month",
                 "year_ce": 1995, "year_be": 2538 },
    "artists": [{ "slug": "…", "name_th": "…", "role": "main", "url": "…" }],
    "ids": { "musicbrainz": "…", "wikidata": "Q…" }
  },
  "attribution": { "source": "thaimusictimeline.com", … }
}
  • วันที่ออกตัดตามความแม่นยำที่รู้จริง (day / month / year) — ห้ามเติมวันหรือเดือนเอง Dates are truncated to their known precision — never pad unknown days or months.
  • ไม่มีเนื้อเพลงหรือท่อนฮุกใน API No lyrics or hook lines are available through the API.
  • youtube_video_id มีเฉพาะคลิปจากช่องทางการที่ทีมงานตรวจแล้ว youtube_video_id is set only for editor-verified official channels.

ขีดจำกัดและ error Limits and errors

แต่ละ key มีขีดจำกัดต่อนาทีและโควตาต่อวัน (รีเซ็ต 00:00 UTC) ดูที่เหลือได้จาก header X-Quota-Remaining Each key has a per-minute limit and a daily quota (resets 00:00 UTC); see the X-Quota-Remaining header.

400bad_requestMissing or malformed parameter
401missing_key / invalid_keyNo key, unknown key or revoked key
404not_foundNo such song, artist, label or year
429rate_limited / quota_exceededPer-minute limit or daily quota hit; see Retry-After

เงื่อนไขการใช้ Terms

  • แสดงเครดิต “ข้อมูลจาก thaimusictimeline.com” พร้อมลิงก์กลับหน้าที่เกี่ยวข้อง (ฟิลด์ url) Credit “Data from thaimusictimeline.com” with a link back to the relevant page (the url field).
  • ข้อมูลต้นทางจาก Wikidata และ MusicBrainz (CC0) Underlying data comes from Wikidata and MusicBrainz (CC0).
  • ห้ามแชร์ key; key ที่ใช้ผิดเงื่อนไขจะถูกยกเลิก Do not share keys; keys used against these terms are revoked.