เอกสาร REST API

เรียกใช้ SEO audit ด้วยโปรแกรมผ่าน CheckSEO REST API พร้อมใช้งานในแผน Agency และ Enterprise

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

คำขอ API ทั้งหมดต้องมี API key ของคุณใน Authorization header สร้าง API key ได้ในการตั้งค่าบัญชี

Authorization: Bearer csk_your_api_key_here

API key เริ่มต้นด้วย csk_ เก็บรักษาเป็นความลับ — อย่าเปิดเผยในโค้ดฝั่งไคลเอนต์

Base URL

https://checkseo.site
POST /api/audits

เริ่ม SEO audit ใหม่ ส่งคืน audit_id สำหรับตรวจสอบสถานะ

Request Body (JSON)

Field Type Required Description
urlstringYesURL to audit
langstringNoReport language (en, ru, de, zh, hi, th, fr, es, cs, ar). Default: en
skip_performancebooleanNoSkip Google PageSpeed check
skip_broken_linksbooleanNoSkip broken links check

ตัวอย่าง

curl -X POST https://checkseo.site/api/audits \
  -H "Authorization: Bearer csk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "lang": "en"}'

Response (200)

{
  "audit_id": "a1b2c3d4e5f6...",
  "url": "https://example.com"
}
GET /api/audits/{audit_id}/status

เรียกดู endpoint นี้เพื่อตรวจสอบความคืบหน้าของ audit เมื่อสถานะเป็น "done" ฟิลด์ redirect จะมี URL ของรายงาน

Response

// In progress
{"status": "running", "step": 3, "total": 8, "percent": 37}

// Completed
{"status": "done", "redirect": "/audits/a1b2c3d4...", "percent": 100}

// Error
{"status": "error", "error_message": "...", "percent": 0}
GET /audits/{audit_id}/pdf

ดาวน์โหลดรายงาน audit เป็น PDF แผน Agency/Enterprise ได้ PDF ที่ไม่มีลายน้ำ

ขั้นตอนการทำงานทั่วไป

1 POST /api/audits — เริ่ม audit รับ audit_id
2 GET /api/audits/{id}/status — เรียกดูทุก 2-3 วินาทีจนกว่าสถานะจะเป็น "done"
3 GET /audits/{id} — ดูรายงานฉบับเต็ม
4 GET /audits/{id}/pdf — ดาวน์โหลด PDF (ไม่บังคับ)

ข้อจำกัดอัตราการใช้งาน

แผนปัจจุบัน audit / เดือน API
Free3
Registered5
Pro ($19/mo)30
Agency ($49/mo)100
Enterprise ($149/mo)500

ตัวอย่าง Python

import requests, time

API_KEY = "csk_your_api_key"
BASE = "https://checkseo.site"
HEADERS = {"Authorization": f"Bearer {API_KEY}",
           "Content-Type": "application/json"}

# 1. Start audit
r = requests.post(f"{BASE}/api/audits",
                  json={"url": "https://example.com", "lang": "en"},
                  headers=HEADERS)
audit_id = r.json()["audit_id"]

# 2. Poll until done
while True:
    s = requests.get(f"{BASE}/api/audits/{audit_id}/status").json()
    if s["status"] == "done":
        break
    if s["status"] == "error":
        raise Exception(s["error_message"])
    time.sleep(2)

# 3. Download PDF
pdf = requests.get(f"{BASE}/audits/{audit_id}/pdf",
                   headers=HEADERS)
with open("report.pdf", "wb") as f:
    f.write(pdf.content)

การเข้าถึง API พร้อมใช้งานในแผน Agency ($49/เดือน) และ Enterprise ($149/เดือน)

ดูแผน