{
    "openapi": "3.1.0",
    "info": {
        "title": "APK API",
        "version": "1.0.0",
        "description": "Google Play data API: 4 million apps (live and removed), developers, new releases, removals and title keywords. JSON, UTF-8, CORS enabled.\n\nEvery call costs 0–3 tokens regardless of the number of rows (up to 100); /apps costs 1 token per app. Monthly free tokens are used first, then the purchased balance; if a request fails on our side, the tokens are returned. Remaining tokens are in the `_tokens` field of every response; `_credits` is a deprecated alias.\n\nDocumentation: https://apkapi.com/api-docs.php",
        "contact": {
            "url": "https://apkapi.com/api-docs.php"
        },
        "termsOfService": "https://apkapi.com/legal/terms.php"
    },
    "servers": [
        {
            "url": "https://apkapi.com/api/v1"
        }
    ],
    "security": [
        {
            "ApiKeyHeader": []
        },
        {
            "BearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "แอป"
        },
        {
            "name": "นักพัฒนา"
        },
        {
            "name": "การเปลี่ยนแปลงในสโตร์"
        },
        {
            "name": "ตลาด"
        }
    ],
    "paths": {
        "/account": {
            "get": {
                "operationId": "account",
                "tags": [
                    "Account"
                ],
                "summary": "Your plan, token balance, the monthly reset date and the per-minute limit.",
                "description": "Free: no tokens are charged.",
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/app": {
            "get": {
                "operationId": "app",
                "tags": [
                    "แอป"
                ],
                "summary": "ข้อมูลแอปแบบเต็ม: ชื่อ คำอธิบาย “มีอะไรใหม่” การติดตั้ง (เกณฑ์และตัวเลขที่แน่นอน) คะแนน จำนวนคะแนนและรีวิว การกระจายของดาว ราคา การซื้อในแอป โฆษณา หมวดหมู่ การจัดเรตอายุ เวอร์ชัน Android ขั้นต่ำ วันที่เปิดตัวและอัปเดต ไอคอน ภาพหน้าจอ วิดีโอ นักพัฒนาและเว็บไซต์ของนักพัฒนา สำหรับแอปที่ถูกลบ: ข้อมูลล่าสุดที่บันทึกไว้และวันที่หายไป",
                "description": "ข้อมูลแอปแบบเต็ม: ชื่อ คำอธิบาย “มีอะไรใหม่” การติดตั้ง (เกณฑ์และตัวเลขที่แน่นอน) คะแนน จำนวนคะแนนและรีวิว การกระจายของดาว ราคา การซื้อในแอป โฆษณา หมวดหมู่ การจัดเรตอายุ เวอร์ชัน Android ขั้นต่ำ วันที่เปิดตัวและอัปเดต ไอคอน ภาพหน้าจอ วิดีโอ นักพัฒนาและเว็บไซต์ของนักพัฒนา สำหรับแอปที่ถูกลบ: ข้อมูลล่าสุดที่บันทึกไว้และวันที่หายไป\n\nCost: 1 token per call.",
                "x-tokens": 1,
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "required": true,
                        "description": "ชื่อแพ็กเกจของแอป",
                        "schema": {
                            "type": "string"
                        },
                        "example": "com.whatsapp"
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/apps": {
            "get": {
                "operationId": "apps",
                "tags": [
                    "แอป"
                ],
                "summary": "สูงสุด 100 แอปในหนึ่งคำขอ: GET ?ids=a,b,c หรือ POST พร้อมรายการในเนื้อหา (หนึ่งรายการต่อบรรทัด หรือ JSON {\"ids\": […]}) 1 โทเคนต่อแอป รายการที่ไม่พบจะส่งกลับใน not_found",
                "description": "สูงสุด 100 แอปในหนึ่งคำขอ: GET ?ids=a,b,c หรือ POST พร้อมรายการในเนื้อหา (หนึ่งรายการต่อบรรทัด หรือ JSON {\"ids\": […]}) 1 โทเคนต่อแอป รายการที่ไม่พบจะส่งกลับใน not_found\n\nCost: 1 token per app.",
                "x-tokens": 1,
                "parameters": [
                    {
                        "name": "ids",
                        "in": "query",
                        "required": true,
                        "description": "ชื่อแพ็กเกจคั่นด้วยจุลภาค สูงสุด 100",
                        "schema": {
                            "type": "string"
                        },
                        "example": "com.whatsapp,org.telegram.messenger"
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "operationId": "apps_post",
                "tags": [
                    "แอป"
                ],
                "summary": "Same as GET, with package names in the request body (one per line, or JSON {\"ids\": [...]}).",
                "description": "สูงสุด 100 แอปในหนึ่งคำขอ: GET ?ids=a,b,c หรือ POST พร้อมรายการในเนื้อหา (หนึ่งรายการต่อบรรทัด หรือ JSON {\"ids\": […]}) 1 โทเคนต่อแอป รายการที่ไม่พบจะส่งกลับใน not_found\n\nCost: 1 token per app.",
                "x-tokens": 1,
                "parameters": [],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "text/plain": {
                            "schema": {
                                "type": "string"
                            },
                            "example": "com.whatsapp\norg.telegram.messenger"
                        }
                    }
                }
            }
        },
        "/search": {
            "get": {
                "operationId": "search",
                "tags": [
                    "แอป"
                ],
                "summary": "ค้นหาและกรองทั้งฐานข้อมูล ต้องมีตัวกรองอย่างน้อยหนึ่งตัว หากไม่มี q จะเรียงตามการติดตั้ง",
                "description": "ค้นหาและกรองทั้งฐานข้อมูล ต้องมีตัวกรองอย่างน้อยหนึ่งตัว หากไม่มี q จะเรียงตามการติดตั้ง\n\nCost: 2 tokens per call.",
                "x-tokens": 2,
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "คำสำหรับค้นหาในชื่อ คำอธิบาย และชื่อนักพัฒนา",
                        "schema": {
                            "type": "string"
                        },
                        "example": "photo editor"
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "ID หมวดหมู่ เช่น GAME_PUZZLE (ดู /v1/categories)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "developer_id",
                        "in": "query",
                        "required": false,
                        "description": "ID นักพัฒนาใน Google Play",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "min_installs",
                        "in": "query",
                        "required": false,
                        "description": "ติดตั้งขั้นต่ำ (เกณฑ์ของ Google Play: 1000, 10000…)",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "max_installs",
                        "in": "query",
                        "required": false,
                        "description": "ติดตั้งสูงสุด",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "min_score",
                        "in": "query",
                        "required": false,
                        "description": "คะแนนขั้นต่ำ 0–5",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "min_ratings",
                        "in": "query",
                        "required": false,
                        "description": "คะแนนขั้นต่ำ",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "free",
                        "in": "query",
                        "required": false,
                        "description": "true — เฉพาะแอปฟรี, false — เฉพาะแอปเสียเงิน",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false"
                            ]
                        }
                    },
                    {
                        "name": "ads",
                        "in": "query",
                        "required": false,
                        "description": "true — มีโฆษณา, false — ไม่มี",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false"
                            ]
                        }
                    },
                    {
                        "name": "iap",
                        "in": "query",
                        "required": false,
                        "description": "true — มีการซื้อในแอป",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false"
                            ]
                        }
                    },
                    {
                        "name": "lang",
                        "in": "query",
                        "required": false,
                        "description": "ภาษาของชื่อ รหัส ISO: en, de, pt…",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "released_from",
                        "in": "query",
                        "required": false,
                        "description": "เปิดตัวตั้งแต่วันที่นี้ YYYY-MM-DD",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "released_to",
                        "in": "query",
                        "required": false,
                        "description": "เปิดตัวก่อนหรือในวันที่นี้",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "updated_from",
                        "in": "query",
                        "required": false,
                        "description": "อัปเดตตั้งแต่วันที่นี้",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "updated_to",
                        "in": "query",
                        "required": false,
                        "description": "อัปเดตก่อนหรือในวันที่นี้",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "live (อยู่ในสโตร์, ค่าเริ่มต้น), removed หรือ all",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "live",
                                "removed",
                                "all"
                            ]
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "relevance | installs | real_installs | score | ratings | reviews | released | updated | price",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "description": "desc | asc",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "desc",
                                "asc"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "หน้า เริ่มจาก 1",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per",
                        "in": "query",
                        "required": false,
                        "description": "แถวต่อหน้า 1–100 (ค่าเริ่มต้น 20)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        },
                        "example": 20
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/suggest": {
            "get": {
                "operationId": "suggest",
                "tags": [
                    "แอป"
                ],
                "summary": "คำแนะนำจากตัวอักษรต้นของชื่อ: 10 รายการที่ตรงและยอดนิยมที่สุด ฟรี",
                "description": "คำแนะนำจากตัวอักษรต้นของชื่อ: 10 รายการที่ตรงและยอดนิยมที่สุด ฟรี\n\nCost: 0 tokens per call.",
                "x-tokens": 0,
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "description": "ตัวอักษรต้นของชื่อ อย่างน้อย 2 ตัว",
                        "schema": {
                            "type": "string"
                        },
                        "example": "whats"
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/developer": {
            "get": {
                "operationId": "developer",
                "tags": [
                    "นักพัฒนา"
                ],
                "summary": "นักพัฒนาและแอปทั้งหมดของเขา: จำนวน (ในสโตร์และที่ถูกลบ) ยอดติดตั้งรวม คะแนนเฉลี่ย การเปิดตัวครั้งแรก หมวดหมู่ เว็บไซต์ ในแพ็กเกจ Business: อีเมล โทรศัพท์ ที่อยู่ และชื่อนิติบุคคล",
                "description": "นักพัฒนาและแอปทั้งหมดของเขา: จำนวน (ในสโตร์และที่ถูกลบ) ยอดติดตั้งรวม คะแนนเฉลี่ย การเปิดตัวครั้งแรก หมวดหมู่ เว็บไซต์ ในแพ็กเกจ Business: อีเมล โทรศัพท์ ที่อยู่ และชื่อนิติบุคคล\n\nCost: 2 tokens per call.",
                "x-tokens": 2,
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "required": false,
                        "description": "ID นักพัฒนา (จากข้อมูลแอป: developer.id)",
                        "schema": {
                            "type": "string"
                        },
                        "example": "5191370068110375942"
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "description": "หรือชื่อนักพัฒนาที่ตรงกันทุกตัวอักษร",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "all (ค่าเริ่มต้น), live หรือ removed",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "live",
                                "removed",
                                "all"
                            ]
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "relevance | installs | real_installs | score | ratings | reviews | released | updated | price",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "หน้า เริ่มจาก 1",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per",
                        "in": "query",
                        "required": false,
                        "description": "แถวต่อหน้า 1–100 (ค่าเริ่มต้น 20)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        },
                        "example": 20
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/new": {
            "get": {
                "operationId": "new",
                "tags": [
                    "การเปลี่ยนแปลงในสโตร์"
                ],
                "summary": "แอปใหม่เรียงตามวันที่เปิดตัวครั้งแรก ใหม่สุดก่อน",
                "description": "แอปใหม่เรียงตามวันที่เปิดตัวครั้งแรก ใหม่สุดก่อน\n\nCost: 2 tokens per call.",
                "x-tokens": 2,
                "parameters": [
                    {
                        "name": "since",
                        "in": "query",
                        "required": false,
                        "description": "ตั้งแต่วันที่ YYYY-MM-DD (ค่าเริ่มต้น: 7 วันที่แล้ว)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "until",
                        "in": "query",
                        "required": false,
                        "description": "ถึงวันที่นี้ รวมวันที่นี้",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "ID หมวดหมู่ เช่น GAME_PUZZLE (ดู /v1/categories)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "min_installs",
                        "in": "query",
                        "required": false,
                        "description": "ติดตั้งขั้นต่ำ (เกณฑ์ของ Google Play: 1000, 10000…)",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "lang",
                        "in": "query",
                        "required": false,
                        "description": "ภาษาของชื่อ รหัส ISO: en, de, pt…",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "relevance | installs | real_installs | score | ratings | reviews | released | updated | price",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "หน้า เริ่มจาก 1",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per",
                        "in": "query",
                        "required": false,
                        "description": "แถวต่อหน้า 1–100 (ค่าเริ่มต้น 20)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        },
                        "example": 20
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/removed": {
            "get": {
                "operationId": "removed",
                "tags": [
                    "การเปลี่ยนแปลงในสโตร์"
                ],
                "summary": "แอปที่หายไปจาก Google Play (ไม่พบในทั้ง 19 ประเทศที่เราตรวจสอบ) เรียงตามวันที่หายไป ข้อมูลแอปจะเก็บข้อมูลล่าสุดไว้",
                "description": "แอปที่หายไปจาก Google Play (ไม่พบในทั้ง 19 ประเทศที่เราตรวจสอบ) เรียงตามวันที่หายไป ข้อมูลแอปจะเก็บข้อมูลล่าสุดไว้\n\nCost: 2 tokens per call.",
                "x-tokens": 2,
                "parameters": [
                    {
                        "name": "since",
                        "in": "query",
                        "required": false,
                        "description": "ตั้งแต่วันที่ YYYY-MM-DD (ค่าเริ่มต้น: 7 วันที่แล้ว)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "until",
                        "in": "query",
                        "required": false,
                        "description": "ถึงวันที่นี้ รวมวันที่นี้",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "ID หมวดหมู่ เช่น GAME_PUZZLE (ดู /v1/categories)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "min_installs",
                        "in": "query",
                        "required": false,
                        "description": "ติดตั้งขั้นต่ำ (เกณฑ์ของ Google Play: 1000, 10000…)",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "removed_at | installs | score",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "หน้า เริ่มจาก 1",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per",
                        "in": "query",
                        "required": false,
                        "description": "แถวต่อหน้า 1–100 (ค่าเริ่มต้น 20)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        },
                        "example": 20
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/keywords": {
            "get": {
                "operationId": "keywords",
                "tags": [
                    "ตลาด"
                ],
                "summary": "คำและวลีจากชื่อแอปแยกตามแต่ละภาษา: มีกี่แอปและกี่นักพัฒนาที่ใช้ มีกี่แอปที่แข็งแกร่ง (ติดตั้ง 100,000+ ครั้ง) ยอดติดตั้งรวม สัดส่วนของผู้นำ และคะแนนโอกาส (opportunity)",
                "description": "คำและวลีจากชื่อแอปแยกตามแต่ละภาษา: มีกี่แอปและกี่นักพัฒนาที่ใช้ มีกี่แอปที่แข็งแกร่ง (ติดตั้ง 100,000+ ครั้ง) ยอดติดตั้งรวม สัดส่วนของผู้นำ และคะแนนโอกาส (opportunity)\n\nCost: 2 tokens per call.",
                "x-tokens": 2,
                "parameters": [
                    {
                        "name": "lang",
                        "in": "query",
                        "required": false,
                        "description": "ภาษา ค่าเริ่มต้น en",
                        "schema": {
                            "type": "string"
                        },
                        "example": "en"
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "คำหรือวลี",
                        "schema": {
                            "type": "string"
                        },
                        "example": "vpn"
                    },
                    {
                        "name": "phrase",
                        "in": "query",
                        "required": false,
                        "description": "true — เฉพาะวลีสองคำ, false — เฉพาะคำเดี่ยว",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false"
                            ]
                        }
                    },
                    {
                        "name": "min_apps",
                        "in": "query",
                        "required": false,
                        "description": "แอปขั้นต่ำ",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "max_apps",
                        "in": "query",
                        "required": false,
                        "description": "แอปสูงสุด",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "opportunity | apps | installs | strong | devs | max_installs",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "description": "desc | asc",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "desc",
                                "asc"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "หน้า เริ่มจาก 1",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per",
                        "in": "query",
                        "required": false,
                        "description": "แถวต่อหน้า 1–100 (ค่าเริ่มต้น 20)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        },
                        "example": 20
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/categories": {
            "get": {
                "operationId": "categories",
                "tags": [
                    "ตลาด"
                ],
                "summary": "ทุกหมวดหมู่พร้อมจำนวนแอปและยอดติดตั้งรวม ฟรี",
                "description": "ทุกหมวดหมู่พร้อมจำนวนแอปและยอดติดตั้งรวม ฟรี\n\nCost: 0 tokens per call.",
                "x-tokens": 0,
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "live (อยู่ในสโตร์, ค่าเริ่มต้น), removed หรือ all",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "live",
                                "removed",
                                "all"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/free_domains": {
            "get": {
                "operationId": "free_domains",
                "tags": [
                    "ตลาด"
                ],
                "summary": "แอปที่โดเมนเว็บไซต์ของนักพัฒนาว่างให้จดทะเบียน พร้อมความนิยมของแอป เปิดให้ใช้หลังซื้อโทเคนครั้งแรก",
                "description": "แอปที่โดเมนเว็บไซต์ของนักพัฒนาว่างให้จดทะเบียน พร้อมความนิยมของแอป เปิดให้ใช้หลังซื้อโทเคนครั้งแรก\n\nCost: 3 tokens per call. Opens after the first token purchase.",
                "x-tokens": 3,
                "parameters": [
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "ID หมวดหมู่ เช่น GAME_PUZZLE (ดู /v1/categories)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "min_installs",
                        "in": "query",
                        "required": false,
                        "description": "ติดตั้งขั้นต่ำ (เกณฑ์ของ Google Play: 1000, 10000…)",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "live (อยู่ในสโตร์, ค่าเริ่มต้น), removed หรือ all",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "live",
                                "removed",
                                "all"
                            ]
                        }
                    },
                    {
                        "name": "tld",
                        "in": "query",
                        "required": false,
                        "description": "โซนโดเมน เช่น com",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "relevance | installs | real_installs | score | ratings | reviews | released | updated | price",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "หน้า เริ่มจาก 1",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per",
                        "in": "query",
                        "required": false,
                        "description": "แถวต่อหน้า 1–100 (ค่าเริ่มต้น 20)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        },
                        "example": 20
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/charts": {
            "get": {
                "operationId": "charts",
                "tags": [
                    "ตลาด"
                ],
                "summary": "ชาร์ตท็อปของ Google Play สำหรับหนึ่งประเทศและหนึ่งหมวดหมู่: สูงสุด 200 อันดับ การเปลี่ยนแปลงอันดับจากสแนปช็อตก่อนหน้า (change: ขึ้นมากี่อันดับ, \"new\" คือเข้าชาร์ตใหม่) ไอคอน และการติดตั้ง",
                "description": "ชาร์ตท็อปของ Google Play สำหรับหนึ่งประเทศและหนึ่งหมวดหมู่: สูงสุด 200 อันดับ การเปลี่ยนแปลงอันดับจากสแนปช็อตก่อนหน้า (change: ขึ้นมากี่อันดับ, \"new\" คือเข้าชาร์ตใหม่) ไอคอน และการติดตั้ง\n\nCost: 2 tokens per call.",
                "x-tokens": 2,
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": true,
                        "description": "ประเทศ รหัส ISO: US, DE, BR…",
                        "schema": {
                            "type": "string"
                        },
                        "example": "US"
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "required": true,
                        "description": "หมวดหมู่ เช่น GAME_PUZZLE",
                        "schema": {
                            "type": "string"
                        },
                        "example": "GAME_PUZZLE"
                    },
                    {
                        "name": "collection",
                        "in": "query",
                        "required": false,
                        "description": "free | paid | grossing",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "free",
                                "paid",
                                "grossing"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "หน้า เริ่มจาก 1",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per",
                        "in": "query",
                        "required": false,
                        "description": "แถวต่อหน้า 1–100 (ค่าเริ่มต้น 20)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        },
                        "example": 20
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/rankings": {
            "get": {
                "operationId": "rankings",
                "tags": [
                    "ตลาด"
                ],
                "summary": "ทุกชาร์ตที่แอปติดอันดับในสแนปช็อตล่าสุด: ประเทศ หมวดหมู่ คอลเลกชัน อันดับ รวมถึงจำนวนชาร์ต จำนวนประเทศ และอันดับที่ดีที่สุด",
                "description": "ทุกชาร์ตที่แอปติดอันดับในสแนปช็อตล่าสุด: ประเทศ หมวดหมู่ คอลเลกชัน อันดับ รวมถึงจำนวนชาร์ต จำนวนประเทศ และอันดับที่ดีที่สุด\n\nCost: 1 token per call.",
                "x-tokens": 1,
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "required": true,
                        "description": "ชื่อแพ็กเกจของแอป",
                        "schema": {
                            "type": "string"
                        },
                        "example": "com.whatsapp"
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "เพียงประเทศเดียว",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "collection",
                        "in": "query",
                        "required": false,
                        "description": "free | paid | grossing",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "free",
                                "paid",
                                "grossing"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/availability": {
            "get": {
                "operationId": "availability",
                "tags": [
                    "ตลาด"
                ],
                "summary": "ประเทศที่แอปมีให้บริการบน Google Play (จาก hreflang ใน sitemap ของสโตร์) หากมี 190 ประเทศขึ้นไป จะส่งกลับ worldwide = true โดยไม่มีรายการ",
                "description": "ประเทศที่แอปมีให้บริการบน Google Play (จาก hreflang ใน sitemap ของสโตร์) หากมี 190 ประเทศขึ้นไป จะส่งกลับ worldwide = true โดยไม่มีรายการ\n\nCost: 1 token per call.",
                "x-tokens": 1,
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "required": true,
                        "description": "ชื่อแพ็กเกจของแอป",
                        "schema": {
                            "type": "string"
                        },
                        "example": "com.whatsapp"
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/markets": {
            "get": {
                "operationId": "markets",
                "tags": [
                    "ตลาด"
                ],
                "summary": "การแข่งขันของตลาดจากชาร์ตแอปฟรี: เกณฑ์เข้าท็อป 100 และท็อป 200 (ยอดติดตั้งของแอปในอันดับนั้น) สัดส่วนแอปใหม่ (ภายใน 12 เดือน) และแอปท้องถิ่น (≤3 ประเทศ) ในท็อป และขนาดตลาดท้องถิ่น ถ้าไม่ระบุพารามิเตอร์ จะแสดงทุกประเทศ; country: หมวดหมู่ของประเทศเดียว; category: หมวดหมู่เดียวในทุกประเทศ",
                "description": "การแข่งขันของตลาดจากชาร์ตแอปฟรี: เกณฑ์เข้าท็อป 100 และท็อป 200 (ยอดติดตั้งของแอปในอันดับนั้น) สัดส่วนแอปใหม่ (ภายใน 12 เดือน) และแอปท้องถิ่น (≤3 ประเทศ) ในท็อป และขนาดตลาดท้องถิ่น ถ้าไม่ระบุพารามิเตอร์ จะแสดงทุกประเทศ; country: หมวดหมู่ของประเทศเดียว; category: หมวดหมู่เดียวในทุกประเทศ\n\nCost: 1 token per call.",
                "x-tokens": 1,
                "parameters": [
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "ประเทศ รหัส ISO",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "ID หมวดหมู่ เช่น GAME_PUZZLE (ดู /v1/categories)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "entry100 | entry200 | new_share | local_share | local_apps | local_installs | local_new",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "description": "desc | asc",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "desc",
                                "asc"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "หน้า เริ่มจาก 1",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per",
                        "in": "query",
                        "required": false,
                        "description": "แถวต่อหน้า 1–100 (ค่าเริ่มต้น 20)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        },
                        "example": 20
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/stats": {
            "get": {
                "operationId": "stats",
                "tags": [
                    "ตลาด"
                ],
                "summary": "ขนาดฐานข้อมูล: แอปในสโตร์และแอปที่ถูกลบ นักพัฒนา แอปใหม่และแอปที่ถูกลบใน 7 วัน เวลาอัปเดตล่าสุด ฟรี",
                "description": "ขนาดฐานข้อมูล: แอปในสโตร์และแอปที่ถูกลบ นักพัฒนา แอปใหม่และแอปที่ถูกลบใน 7 วัน เวลาอัปเดตล่าสุด ฟรี\n\nCost: 0 tokens per call.",
                "x-tokens": 0,
                "parameters": [],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/health": {
            "get": {
                "operationId": "health",
                "tags": [
                    "Account"
                ],
                "summary": "Service status. No key required.",
                "security": [],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Ok"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "ApiKeyHeader": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key"
            },
            "BearerAuth": {
                "type": "http",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "Tokens": {
                "type": "object",
                "properties": {
                    "cost": {
                        "type": "integer",
                        "description": "tokens this request cost"
                    },
                    "remaining": {
                        "type": "integer",
                        "description": "tokens left (monthly + purchased)"
                    }
                }
            },
            "Ok": {
                "type": "object",
                "required": [
                    "ok"
                ],
                "additionalProperties": true,
                "properties": {
                    "ok": {
                        "type": "boolean",
                        "const": true
                    },
                    "results": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "total": {
                        "type": "integer"
                    },
                    "page": {
                        "type": "integer"
                    },
                    "per": {
                        "type": "integer"
                    },
                    "pages": {
                        "type": "integer"
                    },
                    "_tokens": {
                        "$ref": "#/components/schemas/Tokens"
                    },
                    "_credits": {
                        "$ref": "#/components/schemas/Tokens",
                        "deprecated": true
                    }
                }
            },
            "Error": {
                "type": "object",
                "required": [
                    "ok",
                    "error",
                    "code"
                ],
                "properties": {
                    "ok": {
                        "type": "boolean",
                        "const": false
                    },
                    "error": {
                        "type": "string"
                    },
                    "code": {
                        "type": "string",
                        "examples": [
                            "missing_api_key",
                            "invalid_api_key",
                            "account_blocked",
                            "insufficient_credits",
                            "rate_limited",
                            "invalid_param",
                            "invalid_request",
                            "not_found",
                            "upstream_error",
                            "service_unavailable"
                        ]
                    }
                }
            }
        },
        "responses": {
            "Ok": {
                "description": "Success",
                "headers": {
                    "X-Cache": {
                        "description": "HIT — served from cache, MISS — fresh query to the database",
                        "schema": {
                            "type": "string"
                        }
                    }
                },
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Ok"
                        }
                    }
                }
            },
            "Error": {
                "description": "Error",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        }
    }
}