### Example GET Request for Authorization Endpoint Source: https://docs.kick.com/getting-started/generating-tokens-oauth2-flow This example demonstrates how to construct a GET request to the authorization endpoint. Ensure all placeholder values like client_id, redirect_uri, scopes, code_challenge, and state are replaced with your application's specific details. ```uri GET https://id.kick.com/oauth/authorize? response_type=code& client_id=& redirect_uri=& scope=& code_challenge=& code_challenge_method=S256& state= ``` -------------------------------- ### Golang Signature Verification Example Source: https://docs.kick.com/events/webhook-security A Golang code example demonstrating how to parse the public key and verify the `Kick-Event-Signature` header against the incoming webhook request. ```APIDOC #### Golang ```go import ( "crypto/rsa" "crypto/x509" "encoding/pem" "errors" ) func ParsePublicKey(bs []byte) (rsa.PublicKey, error) { block, _ := pem.Decode(bs) if block == nil { return rsa.PublicKey{}, errors.New("not decodable key") } if block.Type != "PUBLIC KEY" { return rsa.PublicKey{}, errors.New("not public key") } parsed, err := x509.ParsePKIXPublicKey(block.Bytes) if err != nil { return rsa.PublicKey{}, err } publicKey, ok := parsed.(*rsa.PublicKey) if !ok { return rsa.PublicKey{}, errors.New("not expected public key interface") } return *publicKey, nil } import ( "crypto" "crypto/rsa" "crypto/sha256" "encoding/base64" ) func Verify(publicKey *rsa.PublicKey, body []byte, signature []byte) error { decoded := make([]byte, base64.StdEncoding.DecodedLen(len(signature))) n, err := base64.StdEncoding.Decode(decoded, signature) if err != nil { return err } signature = decoded[:n] hashed := sha256.Sum256(body) return rsa.VerifyPKCS1v15(publicKey, crypto.SHA256, hashed[:], signature) } // Parse the Public Key pubkey, err := keysx.ParsePublicKey([]byte(` ----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq/+l1WnlRrGSolDMA+A8 6rAhMbQGmQ2SapVcGM3zq8ANXjnhDWocMqfWcTd95btDydITa10kDvHzw9WQOqp2 MZI7ZyrfzJuz5nhTPCiJwTwnEtWft7nV14BYRDHvlfqPUaZ+1KR4OCaO/wWIk/rQ L/TjY0M70gse8rlBkbo2a8rKhu69RQTRsoaf4DVhDPEeSeI5jVrRDGAMGL3cGuyY 6CLKGdjVEM78g3JfYOvDU/RvfqD7L89TZ3iN94jrmWdGz34JNlEI5hqK8dd7C5EF BEbZ5jgB8s8ReQV8H+MkuffjdAj3ajDDX3DOJMIut1lBrUVD1AaSrGCKHooWoL2e twIDAQAB -----END PUBLIC KEY----- `)) // Create the Signature to compare signature := []byte(fmt.Sprintf("%s.%s.%s", messageID, timestamp, body)) // Verify the Header err := Verify(pubkey, signature, headers["Kick-Event-Signature"]) ``` ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.kick.com/getting-started/generating-tokens-oauth2-flow Perform an HTTP GET request to this page's URL with `ask` and optional `goal` query parameters to get dynamic answers and related documentation excerpts. ```http GET https://docs.kick.com/getting-started/generating-tokens-oauth2-flow.md?ask=&goal= ``` -------------------------------- ### Authorization Endpoint 400 Response Example Source: https://docs.kick.com/getting-started/generating-tokens-oauth2-flow This is an example of an error response from the authorization endpoint, typically indicating an invalid request. ```json { "error": "Invalid request" } ``` -------------------------------- ### Authorization Endpoint 200 Response Example Source: https://docs.kick.com/getting-started/generating-tokens-oauth2-flow This is an example of a successful response from the authorization endpoint, indicating that the user has authorized the application. ```json https://yourapp.com/callback?code=&state=random-state ``` -------------------------------- ### Webhook POST Request Example Source: https://docs.kick.com/drops/drops-guide This is an example of the POST request Kick sends to your webhook endpoint when a reward is claimed. Ensure your endpoint is ready to receive this data. ```json { "claim_id": "string", // ULID "user_id": "integer", // uint64 "campaign_id": "string", // ULID "reward_id": "string", // ULID "external_id": "string" // Optional - external reward reference } ``` -------------------------------- ### Example Token Endpoint Request Source: https://docs.kick.com/getting-started/generating-tokens-oauth2-flow This example demonstrates the structure and parameters required for a POST request to the Kick API token endpoint to exchange an authorization code for tokens. ```http POST https://id.kick.com/oauth/token Headers: Content-Type: application/x-www-form-urlencoded Body: { grant_type=authorization_code client_id= client_secret= redirect_uri= code_verifier= code= } ``` -------------------------------- ### Query Documentation with HTTP GET Source: https://docs.kick.com/apis/kicks To ask questions about the documentation or retrieve additional context, perform an HTTP GET request to the page URL with the `ask` query parameter. An optional `goal` parameter can be included to tailor the response. ```http GET https://docs.kick.com/apis/kicks.md?ask=&goal= ``` -------------------------------- ### Example Usage of Webhook Verification in Go Source: https://docs.kick.com/events/webhook-security Demonstrates how to parse the public key, construct the signature string, and verify the `Kick-Event-Signature` header against the request body. ```go // Parse the Public Key pubkey, err := keysx.ParsePublicKey([]byte(` -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq/+l1WnlRrGSolDMA+A8 6rAhMbQGmQ2SapVcGM3zq8ANXjnhDWocMqfWcTd95btDydITa10kDvHzw9WQOqp2 MZI7ZyrfzJuz5nhTPCiJwTwnEtWft7nV14BYRDHvlfqPUaZ+1KR4OCaO/wWIk/rQ L/TjY0M70gse8rlBkbo2a8rKhu69RQTRsoaf4DVhDPEeSeI5jVrRDGAMGL3cGuyY 6CLKGdjVEM78g3JfYOvDU/RvfqD7L89TZ3iN94jrmWdGz34JNlEI5hqK8dd7C5EF BEbZ5jgB8s8ReQV8H+MkuffjdAj3ajDDX3DOJMIut1lBrUVD1AaSrGCKHooWoL2e twIDAQAB -----END PUBLIC KEY----- `)) // Create the Signature to compare signature := []byte(fmt.Sprintf("%s.%s.%s", messageID, timestamp, body)) // Verify the Header err := Verify(pubkey, signature, headers["Kick-Event-Signature"]) ``` -------------------------------- ### Query Documentation with GET Request Source: https://docs.kick.com/events/event-types Use this endpoint to ask questions about the documentation. Include your specific question in the 'ask' parameter and an optional 'goal' parameter to tailor the response. ```http GET https://docs.kick.com/events/event-types.md?ask=&goal= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.kick.com/drops/public-api Use this GET request to query the documentation dynamically. Include your question in the `ask` parameter and optionally specify your broader goal in the `goal` parameter. ```http GET https://docs.kick.com/drops/public-api.md?ask=&goal= ``` -------------------------------- ### Get KICKs Leaderboard API Specification Source: https://docs.kick.com/apis/kicks This OpenAPI 3.1.1 specification outlines the GET request for retrieving the KICKs leaderboard. It includes details on authentication, parameters, and response schemas for successful requests and errors. ```json {"openapi":"3.1.1","info":{"title":"Kick Dev Public API","version":"1.0.0"},"servers":[{"url":"https://api.kick.com"}],"security":[{"UserAccessToken":["kicks:read"]}],"components":{"securitySchemes":{"UserAccessToken":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://id.kick.com/oauth/authorize","tokenUrl":"https://id.kick.com/oauth/token","scopes":{"channel:read":"View channel information in Kick including channel description, category, etc.","channel:rewards:read":"Read Channel points rewards information on a channel","channel:rewards:write":"Read, add, edit and delete Channel points rewards on a channel","channel:write":"Update livestream metadata for a channel based on the channel ID","chat:write":"Send chat messages and allow chat bots to post in your chat","events:subscribe":"Subscribe to all channel events on Kick e.g. chat messages, follows, subscriptions","kicks:read":"View KICKs related information in Kick e.g leaderboards, etc.","moderation:ban":"Execute moderation actions for moderators","moderation:chat_message:manage":"Execute moderation actions on chat messages","streamkey:read":"Read a user's stream URL and stream key","user:read":"View user information in Kick including username, streamer ID, etc."}}}}},"schemas":{"httpx.Response":{"properties":{"data":{},"message":{"type":"string"}},"type":"object"},"endpoints.KicksLeaderboard":{"properties":{"lifetime":{"$ref":"#/components/schemas/endpoints.KicksLeaderboardEntry","type":"array"},"month":{"$ref":"#/components/schemas/endpoints.KicksLeaderboardEntry","type":"array"},"week":{"$ref":"#/components/schemas/endpoints.KicksLeaderboardEntry","type":"array"}},"type":"object"},"endpoints.KicksLeaderboardEntry":{"properties":{"gifted_amount":{"type":"integer"},"rank":{"type":"integer"},"user_id":{"type":"integer"},"username":{"type":"string"}},"type":"object"}}},"paths":{"/public/v1/kicks/leaderboard":{"get":{"description":"Gets the KICKs leaderboard for the authenticated broadcaster.","parameters":[{"schema":{"type":"integer","default":10,"maximum":100,"minimum":1},"description":"The number of entries from the top of the leaderboard to return. For example, 10 will fetch the top 10 entries.","in":"query","name":"top"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/httpx.Response"},{"properties":{"data":{"$ref":"#/components/schemas/endpoints.KicksLeaderboard"}},"type":"object"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/httpx.Response"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"$ref":"#/components/schemas/httpx.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"$ref":"#/components/schemas/httpx.Response"}}}}},"summary":"Get KICKs Leaderboard","tags":["kicks"]}}}} ``` -------------------------------- ### Get Public Key Source: https://docs.kick.com/apis/public-key Retrieve the public key used for verifying signatures. ```APIDOC ## GET /public/v1/public-key ### Description Retrieve the public key used for verifying signatures. ### Method GET ### Endpoint /public/v1/public-key ### Response #### Success Response (200) - **data** (object) - Contains the public key details. - **public_key** (string) - The public key string. - **message** (string) - A message indicating the status of the operation. #### Response Example ```json { "data": { "public_key": "your_public_key_string" }, "message": "OK" } ``` ``` -------------------------------- ### Get Events Subscriptions (OpenAPI) Source: https://docs.kick.com/events/subscribe-to-events Use this OpenAPI specification to retrieve a list of your current event subscriptions. You can filter the results by providing a broadcaster user ID. ```json { "openapi":"3.1.1", "info":{"title":"Kick Dev Public API","version":"1.0.0"}, "servers":[{"url":"https://api.kick.com"}], "security":[{"UserAccessToken":[]},{"AppAccessToken":[]}], "components":{"securitySchemes":{"UserAccessToken":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://id.kick.com/oauth/authorize","tokenUrl":"https://id.kick.com/oauth/token","scopes":{"channel:read":"View channel information in Kick including channel description, category, etc.","channel:rewards:read":"Read Channel points rewards information on a channel","channel:rewards:write":"Read, add, edit and delete Channel points rewards on a channel","channel:write":"Update livestream metadata for a channel based on the channel ID","chat:write":"Send chat messages and allow chat bots to post in your chat","events:subscribe":"Subscribe to all channel events on Kick e.g. chat messages, follows, subscriptions","kicks:read":"View KICKs related information in Kick e.g leaderboards, etc.","moderation:ban":"Execute moderation actions for moderators","moderation:chat_message:manage":"Execute moderation actions on chat messages","streamkey:read":"Read a user's stream URL and stream key","user:read":"View user information in Kick including username, streamer ID, etc."}}}},"AppAccessToken":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://id.kick.com/oauth/token"}}}},"schemas":{"httpx.Response":{"properties":{"data":{},"message":{"type":"string"}},"type":"object"},"endpoints.GetEventSubscription":{"properties":{"app_id":{"type":"string"},"broadcaster_user_id":{"type":"integer"},"created_at":{"type":"string"},"event":{"type":"string"},"id":{"type":"string"},"method":{"type":"string"},"updated_at":{"type":"string"},"version":{"type":"integer"}},"type":"object"},"endpoints.ErrorResponse":{"properties":{"data":{},"message":{"type":"string"}},"type":"object"}}},"paths":{"/public/v1/events/subscriptions":{"get":{"description":"Get events subscriptions","parameters":[{"schema":{"type":"integer","format":"int64"},"description":"Broadcaster User ID to filter by","in":"query","name":"broadcaster_user_id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/httpx.Response"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/endpoints.GetEventSubscription"},"type":"array"}},"type":"object"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/httpx.Response"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"$ref":"#/components/schemas/httpx.Response"}}}},"403":{"description":"Forbidden","content":{"application/json":{"$ref":"#/components/schemas/httpx.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"$ref":"#/components/schemas/endpoints.ErrorResponse"}}}}},"summary":"Get Events Subscriptions","tags":["events","subscriptions"]}}}} ``` -------------------------------- ### Livestream Status Updated - Stream Started Source: https://docs.kick.com/events/event-types This event is triggered when a livestream begins. It provides details about the broadcaster and the stream's current status, indicating that `is_live` is true. ```APIDOC ## Livestream Status Updated - Stream Started ### Description This event is triggered when a livestream begins. It provides details about the broadcaster and the stream's current status, indicating that `is_live` is true. ### Event Type livestream.status.updated ### Event Version 1 ### Payload Example ```json { "broadcaster": { "is_anonymous": false, "user_id": 123456789, "username": "broadcaster_name", "is_verified": true, "profile_picture": "https://example.com/broadcaster_avatar.jpg", "channel_slug": "broadcaster_channel", "identity": null }, "is_live": true, "title": "Stream Title", "started_at": "2025-01-01T11:00:00+11:00", "ended_at": null } ``` ``` -------------------------------- ### Get Livestreams API Definition Source: https://docs.kick.com/apis/livestreams This OpenAPI 3.1.1 definition outlines the 'Get Livestreams' endpoint. It allows filtering by broadcaster user ID, category ID, and language, with options to limit results and sort by viewer count or start time. Note that this endpoint is deprecated. ```json {"openapi":"3.1.1","info":{"title":"Kick Dev Public API","version":"1.0.0"},"servers":[{"url":"https://api.kick.com"}],"security":[{"UserAccessToken":[]},{"AppAccessToken":[]}],"components":{"securitySchemes":{"UserAccessToken":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://id.kick.com/oauth/authorize","tokenUrl":"https://id.kick.com/oauth/token","scopes":{"channel:read":"View channel information in Kick including channel description, category, etc.","channel:rewards:read":"Read Channel points rewards information on a channel","channel:rewards:write":"Read, add, edit and delete Channel points rewards on a channel","channel:write":"Update livestream metadata for a channel based on the channel ID","chat:write":"Send chat messages and allow chat bots to post in your chat","events:subscribe":"Subscribe to all channel events on Kick e.g. chat messages, follows, subscriptions","kicks:read":"View KICKs related information in Kick e.g leaderboards, etc.","moderation:ban":"Execute moderation actions for moderators","moderation:chat_message:manage":"Execute moderation actions on chat messages","streamkey:read":"Read a user's stream URL and stream key","user:read":"View user information in Kick including username, streamer ID, etc."}}}},"AppAccessToken":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://id.kick.com/oauth/token"}}}},"schemas":{"httpx.Response":{"properties":{"data":{},"message":{"type":"string"}},"type":"object"},"endpoints.LivestreamWithCategory":{"properties":{"broadcaster_user_id":{"type":"integer"},"category":{"$ref":"#/components/schemas/endpoints.CategoryResponse"},"channel_id":{"type":"integer"},"custom_tags":{"items":{"type":"string"},"type":"array"},"has_mature_content":{"type":"boolean"},"language":{"type":"string"},"profile_picture":{"type":"string"},"slug":{"type":"string"},"started_at":{"type":"string"},"stream_title":{"type":"string"},"thumbnail":{"type":"string"},"viewer_count":{"type":"integer"}},"type":"object"},"endpoints.CategoryResponse":{"properties":{"id":{"type":"integer"},"name":{"type":"string"},"thumbnail":{"type":"string"}},"type":"object"}}},"paths":{"/public/v1/livestreams":{"get":{"deprecated":true,"description":"Get Livestreams based on broadcaster_user_id, category_id, language, limit, and sort.","parameters":[{"schema":{"type":"array","items":{"format":"int64","type":"integer"}},"style":"form","explode":true,"description":"Broadcaster User IDs (up to 50)","in":"query","name":"broadcaster_user_id"},{"schema":{"type":"integer","format":"int64"},"description":"Category ID","in":"query","name":"category_id"},{"schema":{"type":"string"},"description":"Language of the livestream","in":"query","name":"language"},{"schema":{"type":"integer","format":"int64","default":25,"maximum":100,"minimum":1},"description":"Limit the number of results","in":"query","name":"limit"},{"schema":{"type":"string","default":"viewer_count","enum":["viewer_count","started_at"]},"description":"Sort by viewer_count or started_at","in":"query","name":"sort"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/httpx.Response"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/endpoints.LivestreamWithCategory"},"type":"array"}},"type":"object"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/httpx.Response"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"$ref":"#/components/schemas/httpx.Response"}}}},"403":{"description":"Forbidden","content":{"application/json":{"$ref":"#/components/schemas/httpx.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"$ref":"#/components/schemas/httpx.Response"}}}}},"summary":"Get Livestreams","tags":["livestreams"]}}}} ``` -------------------------------- ### Get Livestreams Source: https://docs.kick.com/apis/livestreams Retrieves a list of livestreams. This endpoint can be filtered by broadcaster user IDs, category ID, language, and can be sorted by viewer count or start time. It also supports limiting the number of results returned. ```APIDOC ## GET /public/v1/livestreams ### Description Get Livestreams based on broadcaster_user_id, category_id, language, limit, and sort. ### Method GET ### Endpoint /public/v1/livestreams ### Parameters #### Query Parameters - **broadcaster_user_id** (array of integers) - Required - Broadcaster User IDs (up to 50) - **category_id** (integer) - Optional - Category ID - **language** (string) - Optional - Language of the livestream - **limit** (integer) - Optional - Limit the number of results. Default: 25, Max: 100, Min: 1 - **sort** (string) - Optional - Sort by viewer_count or started_at. Default: "viewer_count". Allowed values: "viewer_count", "started_at" ### Response #### Success Response (200) - **data** (array of objects) - Contains a list of livestream objects. - **broadcaster_user_id** (integer) - **category** (object) - **id** (integer) - **name** (string) - **thumbnail** (string) - **channel_id** (integer) - **custom_tags** (array of strings) - **has_mature_content** (boolean) - **language** (string) - **profile_picture** (string) - **slug** (string) - **started_at** (string) - **stream_title** (string) - **thumbnail** (string) - **viewer_count** (integer) #### Response Example { "data": [ { "broadcaster_user_id": 12345, "category": { "id": 1, "name": "Just Chatting", "thumbnail": "https://thumbnails.kick.com/category/1.png" }, "channel_id": 67890, "custom_tags": ["tag1", "tag2"], "has_mature_content": false, "language": "en", "profile_picture": "https://thumbnails.kick.com/user/12345.png", "slug": "user/stream", "started_at": "2023-10-27T10:00:00Z", "stream_title": "My Awesome Stream", "thumbnail": "https://thumbnails.kick.com/live/12345/1698397200.jpg", "viewer_count": 500 } ], "message": "OK" } ``` -------------------------------- ### Livestream Status Updated: Stream Started Source: https://docs.kick.com/events/event-types This event is triggered when a broadcaster starts a new livestream. It includes details about the broadcaster and the stream's current status, including the start time. ```json Headers - Kick-Event-Type: "livestream.status.updated" - Kick-Event-Version: “1” { "broadcaster": { "is_anonymous": false, "user_id": 123456789, "username": "broadcaster_name", "is_verified": true, "profile_picture": "https://example.com/broadcaster_avatar.jpg", "channel_slug": "broadcaster_channel", "identity": null }, "is_live": true, "title": "Stream Title", "started_at": "2025-01-01T11:00:00+11:00", "ended_at": null } ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.kick.com/apis/moderation Use this endpoint to ask questions about the documentation when information is not explicitly present or requires clarification. The 'ask' parameter is for specific questions, and 'goal' is optional for broader context. ```http GET https://docs.kick.com/apis/moderation.md?ask=&goal= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.kick.com/events/subscribe-to-events Use this endpoint to ask questions about the documentation when the answer is not explicitly present on the page. The `ask` parameter is mandatory for specifying your question, and the `goal` parameter can be used to provide broader context for the desired outcome. ```http GET https://docs.kick.com/events/subscribe-to-events.md?ask=&goal= ``` -------------------------------- ### Query Documentation with Ask and Goal Parameters Source: https://docs.kick.com/apis/channels Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. 'ask' is the immediate question, and 'goal' describes the broader end goal. ```HTTP GET https://docs.kick.com/apis/channels.md?ask=&goal= ``` -------------------------------- ### Get Public Key OpenAPI Specification Source: https://docs.kick.com/apis/public-key This JSON object represents the OpenAPI specification for the Get Public Key endpoint. It details the request and response structure for retrieving the public key. ```json {"openapi":"3.1.1","info":{"title":"Kick Dev Public API","version":"1.0.0"},"servers":[{"url":"https://api.kick.com"}],"paths":{"/public/v1/public-key":{"get":{"description":"Retrieve the public key used for verifying signatures.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/endpoints.GetPublicKeyResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/httpx.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/httpx.Response"}}}}},"summary":"Get Public Key","tags":["PublicKey"]}}},"components":{"schemas":{"endpoints.GetPublicKeyResponse":{"properties":{"data":{"$ref":"#/components/schemas/endpoints.PublicKey"},"message":{"type":"string"}},"type":"object"},"endpoints.PublicKey":{"properties":{"public_key":{"type":"string"}},"type":"object"},"httpx.Response":{"properties":{"data":{},"message":{"type":"string"}},"type":"object"}}}} ``` -------------------------------- ### Query Documentation API Source: https://docs.kick.com/apis/public-key To query this documentation dynamically, perform an HTTP GET request to the page URL with the `ask` query parameter and an optional `goal` parameter. The `ask` parameter should contain a specific, self-contained question in natural language. ```http GET https://docs.kick.com/apis/public-key.md?ask=&goal= ``` -------------------------------- ### Get KICKs Leaderboard Source: https://docs.kick.com/apis/kicks Gets the KICKs leaderboard for the authenticated broadcaster. This endpoint allows you to retrieve a ranked list of users based on KICKs, with options to specify the number of top entries to fetch. ```APIDOC ## GET /public/v1/kicks/leaderboard ### Description Gets the KICKs leaderboard for the authenticated broadcaster. ### Method GET ### Endpoint /public/v1/kicks/leaderboard ### Parameters #### Query Parameters - **top** (integer) - Optional - The number of entries from the top of the leaderboard to return. For example, 10 will fetch the top 10 entries. (default: 10, minimum: 1, maximum: 100) ### Responses #### Success Response (200) - **data** (object) - Contains the leaderboard information, including lifetime, month, and week rankings. - **lifetime** (array) - List of leaderboard entries for all time. - **month** (array) - List of leaderboard entries for the current month. - **week** (array) - List of leaderboard entries for the current week. Each entry in the arrays has the following properties: - **gifted_amount** (integer) - The amount gifted. - **rank** (integer) - The user's rank. - **user_id** (integer) - The ID of the user. - **username** (string) - The username of the user. #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **500** - Internal Server Error ``` -------------------------------- ### Get Categories API Specification Source: https://docs.kick.com/apis/categories This OpenAPI 3.1.1 specification defines the 'Get Categories' endpoint. It outlines the request parameters for filtering categories by cursor, limit, names, tags, or IDs, and the structure of the paginated response. ```json {"openapi":"3.1.1","info":{"title":"Kick Dev Public API","version":"1.0.0"},"servers":[{"url":"https://api.kick.com"}],"security":[{"UserAccessToken":[]},{"AppAccessToken":[]}],"components":{"securitySchemes":{"UserAccessToken":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://id.kick.com/oauth/authorize","tokenUrl":"https://id.kick.com/oauth/token","scopes":{"channel:read":"View channel information in Kick including channel description, category, etc.","channel:rewards:read":"Read Channel points rewards information on a channel","channel:rewards:write":"Read, add, edit and delete Channel points rewards on a channel","channel:write":"Update livestream metadata for a channel based on the channel ID","chat:write":"Send chat messages and allow chat bots to post in your chat","events:subscribe":"Subscribe to all channel events on Kick e.g. chat messages, follows, subscriptions","kicks:read":"View KICKs related information in Kick e.g leaderboards, etc.","moderation:ban":"Execute moderation actions for moderators","moderation:chat_message:manage":"Execute moderation actions on chat messages","streamkey:read":"Read a user's stream URL and stream key","user:read":"View user information in Kick including username, streamer ID, etc."}}}},"AppAccessToken":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://id.kick.com/oauth/token"}}}},"schemas":{"endpoints.PaginatedResponse-endpoints_CategoryWithTags":{"properties":{"data":{"items":{"$ref":"#/components/schemas/endpoints.CategoryWithTags"},"type":"array"},"message":{"type":"string"},"pagination":{"$ref":"#/components/schemas/endpoints.Pagination"}},"required":["data","message","pagination"],"type":"object"},"endpoints.CategoryWithTags":{"properties":{"id":{"type":"integer"},"name":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"thumbnail":{"type":"string"}},"type":"object"},"endpoints.Pagination":{"properties":{"next_cursor":{"type":"string"}},"required":["next_cursor"],"type":"object"},"endpoints.SwagPaginatedErrResp":{"properties":{"data":{},"message":{"type":"string"},"pagination":{}},"required":["message"],"type":"object"}}},"paths":{"/public/v2/categories":{"get":{"description":"Get Categories based on the cursor, limit, names, and tags; or ids.","parameters":[{"schema":{"type":"string","maxLength":28,"minLength":4},"description":"Pagination cursor","in":"query","name":"cursor"},{"schema":{"type":"integer","default":25,"maximum":1000,"minimum":1},"description":"Limit","in":"query","name":"limit"},{"schema":{"type":"array","items":{"type":"string"},"maxLength":100,"minLength":3},"style":"form","explode":false,"description":"Category names","in":"query","name":"name"},{"schema":{"type":"array","items":{"type":"string"},"maxLength":100,"minLength":3},"style":"form","explode":false,"description":"Category tags","in":"query","name":"tag"},{"schema":{"type":"array","items":{"format":"int64","type":"integer"},"minimum":1},"style":"form","explode":false,"description":"Category IDs","in":"query","name":"id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/endpoints.PaginatedResponse-endpoints_CategoryWithTags"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/endpoints.SwagPaginatedErrResp"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/endpoints.SwagPaginatedErrResp"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/endpoints.SwagPaginatedErrResp"}}}}},"summary":"Get Categories","tags":["categories"]}}}} ``` -------------------------------- ### Get Users API Specification Source: https://docs.kick.com/apis/users This OpenAPI 3.1.1 specification defines the endpoint for retrieving user information. It includes details on request parameters, response schemas, and security requirements. Use this to understand the structure and capabilities of the Get Users API. ```json {"openapi":"3.1.1","info":{"title":"Kick Dev Public API","version":"1.0.0"},"servers":[{"url":"https://api.kick.com"}],"security":[{"UserAccessToken":["user:read"]},{"AppAccessToken":[]}],"components":{"securitySchemes":{"UserAccessToken":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://id.kick.com/oauth/authorize","tokenUrl":"https://id.kick.com/oauth/token","scopes":{"channel:read":"View channel information in Kick including channel description, category, etc.","channel:rewards:read":"Read Channel points rewards information on a channel","channel:rewards:write":"Read, add, edit and delete Channel points rewards on a channel","channel:write":"Update livestream metadata for a channel based on the channel ID","chat:write":"Send chat messages and allow chat bots to post in your chat","events:subscribe":"Subscribe to all channel events on Kick e.g. chat messages, follows, subscriptions","kicks:read":"View KICKs related information in Kick e.g leaderboards, etc.","moderation:ban":"Execute moderation actions for moderators","moderation:chat_message:manage":"Execute moderation actions on chat messages","streamkey:read":"Read a user's stream URL and stream key","user:read":"View user information in Kick including username, streamer ID, etc."}}}},"AppAccessToken":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://id.kick.com/oauth/token"}}}},"schemas":{"httpx.Response":{"properties":{"data":{},"message":{"type":"string"}},"type":"object"},"endpoints.GetUser":{"properties":{"email":{"type":"string"},"name":{"type":"string"},"profile_picture":{"type":"string"},"user_id":{"type":"integer"}},"type":"object"}}},"paths":{"/public/v1/users":{"get":{"description":"Retrieve user information based on provided user IDs.\nIf no user IDs are specified, the information for the currently authorised user will be returned by default.","parameters":[{"schema":{"type":"array","items":{"format":"int64","type":"integer"}},"style":"form","explode":true,"description":"User IDs","in":"query","name":"id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/httpx.Response"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/endpoints.GetUser"},"type":"array"}},"type":"object"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/httpx.Response"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"$ref":"#/components/schemas/httpx.Response"}}}},"403":{"description":"Forbidden","content":{"application/json":{"$ref":"#/components/schemas/httpx.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"$ref":"#/components/schemas/httpx.Response"}}}}},"summary":"Get Users","tags":["users"]}}}} ``` -------------------------------- ### Generate App Access Token (POST /oauth/token) Source: https://docs.kick.com/getting-started/generating-tokens-oauth2-flow Use your application's client ID and client secret to generate an app access token. This token is required to fetch public data from Kick. ```http POST https://id.kick.com/oauth/token Headers: Content-Type: application/x-www-form-urlencoded Body: { grant_type=client_credentials client_id= client_secret= } ``` ```json { "access_token": "", "expires_in": "", "token_type": "" } ``` -------------------------------- ### Verify Signature in Go Source: https://docs.kick.com/events/webhook-security Verifies the provided signature against the request body using the given public key. The signature must be Base64 encoded. ```go import ( "crypto" "crypto/rsa" "crypto/sha256" "encoding/base64" ) func Verify(publicKey *rsa.PublicKey, body []byte, signature []byte) error { decoded := make([]byte, base64.StdEncoding.DecodedLen(len(signature))) n, err := base64.StdEncoding.Decode(decoded, signature) if err != nil { return err } signature = decoded[:n] hashed := sha256.Sum256(body) return rsa.VerifyPKCS1v15(publicKey, crypto.SHA256, hashed[:], signature) } ``` -------------------------------- ### Get Channels Source: https://docs.kick.com/apis/channels Retrieve channel information based on provided broadcaster user IDs or channel slugs. You can provide no parameters to get information for the currently authenticated user, or specify up to 50 broadcaster_user_ids or slugs. Note that you cannot mix these parameter types in a single request. ```APIDOC ## Get Channels ### Description Retrieve channel information based on provided broadcaster user IDs or channel slugs. You can either: 1. Provide no parameters (returns information for the currently authenticated user) 2. Provide only broadcaster_user_id parameters (up to 50) 3. Provide only slug parameters (up to 50, each max 25 characters) Note: You cannot mix broadcaster_user_id and slug parameters in the same request. ### Method GET ### Endpoint /public/v1/channels ### Parameters #### Query Parameters - **broadcaster_user_id** (array of integer) - Optional - Broadcaster User IDs (cannot be used with slug) - **slug** (array of string) - Optional - Channel slugs (cannot be used with broadcaster_user_id) ### Response #### Success Response (200) - **data** (array of object) - Array of channel objects. - **active_subscribers_count** (integer) - **banner_picture** (string) - **broadcaster_user_id** (integer) - **canceled_subscribers_count** (integer) - **category** (object) - **id** (integer) - **name** (string) - **thumbnail** (string) - **channel_description** (string) - **slug** (string) - **stream** (object) - **custom_tags** (array of string) - **is_live** (boolean) - **is_mature** (boolean) - **key** (string) - **language** (string) - **start_time** (string) - **thumbnail** (string) - **url** (string) - **viewer_count** (integer) - **stream_title** (string) #### Error Response - **400** - Invalid parameters or mixed parameter types - **401** - Unauthorized - **403** - Forbidden - **500** - Internal Server Error ``` -------------------------------- ### Webhook Headers Source: https://docs.kick.com/events/webhook-security These are the headers that will be included with every webhook event sent from Kick. ```APIDOC ## Webhook Headers | Header | Type | Short Description | | ------------------------------ | -------------------- | -------------------------------------- | | `Kick-Event-Message-Id` | ULID | Unique message ID, idempotent key | | `Kick-Event-Subscription-Id` | ULID | Subscription ID associated with event | | `Kick-Event-Signature` | Base64 Encode String | Signature to verify the sender | | `Kick-Event-Message-Timestamp` | RFC3339 Date-time | Timestamp of when the message was sent | | `Kick-Event-Type` | string | e.g. `chat.message.sent` | | `Kick-Event-Version` | string | e.g. `1` | ``` -------------------------------- ### Signature Creation Source: https://docs.kick.com/events/webhook-security Explains how the `Kick-Event-Signature` is created by concatenating specific header values and the raw request body. ```APIDOC ### Signature Creation The signature is created through the concatenation of the following values into a single string, separated by a `.`: * `Kick-Event-Message-Id` * `Kick-Event-Message-Timestamp` * The raw body of the request ```go signature := []byte(fmt.Sprintf("%s.%s.%s", messageID, timestamp, body)) ``` Once concatenated, the body will be signed with the Kick Private Key. ``` -------------------------------- ### Get Category Source: https://docs.kick.com/apis/categories Retrieves details for a specific category using its ID. This endpoint is deprecated. ```APIDOC ## Get Category ### Description Retrieves category details based on the provided category ID. ### Method GET ### Endpoint /public/v1/categories/{category_id} ### Parameters #### Path Parameters - **category_id** (integer) - Required - The ID of the category to retrieve. ### Responses #### Success Response (200) - **data** (object) - Contains the category details. - **id** (integer) - The unique identifier for the category. - **name** (string) - The name of the category. - **tags** (array of strings) - A list of tags associated with the category. - **thumbnail** (string) - URL to the category's thumbnail image. - **viewer_count** (integer) - The current number of viewers for the category. - **message** (string) - A success message. #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **403** - Forbidden - **404** - Not Found - **500** - Internal Server Error ``` -------------------------------- ### Get Categories Source: https://docs.kick.com/apis/categories Retrieves a list of categories based on a search query. Supports pagination to fetch more results. ```APIDOC ## Get Categories ### Description Retrieves a list of categories based on a search query. Supports pagination to fetch more results. ### Method GET ### Endpoint /public/v1/categories ### Parameters #### Query Parameters - **q** (string) - Required - Search query - **page** (integer) - Optional - Page (defaults to 1 if not provided) ### Response #### Success Response (200) - **data** (array) - An array of category objects, where each object contains: - **id** (integer) - The unique identifier for the category. - **name** (string) - The name of the category. - **thumbnail** (string) - The URL of the category's thumbnail image. #### Response Example { "data": [ { "id": 1, "name": "Just Chatting", "thumbnail": "https://example.com/thumbnails/just_chatting.png" } ], "message": "OK" } ``` -------------------------------- ### OAuth2 Authorization Request with 127.0.0.1 Workaround Source: https://docs.kick.com/getting-started/generating-tokens-oauth2-flow Use this GET request when developing locally and your redirect URI uses `127.0.0.1` instead of `localhost`. A sacrificial query parameter `redirect` is added before `redirect_uri` to circumvent a NextJS bug. ```http GET https://id.kick.com/oauth/authorize? response_type=code& client_id=& redirect=127.0.0.1 redirect_uri=& scope=& code_challenge=& code_challenge_method=S256& state= ```