Introduction
Please note that our Documentation is currently being rebuild. Some pages may be unfinished or contain mistakes.
Authentication
API Key
The Cookie API uses API keys to authenticate requests. You can get your API key from Dashboard. Ensure you keep your API key secure.
How to Use Your API Key
Include your API key in the URL Params or Request Headers of every request:
For security reasons, we recommend using the API key in the request headers. You will find more information about your API Key: here
Authorizations | |
---|---|
Authorization String Required | <API_Key> |
curl --location 'https://api.cookie-api.com/api/api-key' \--header 'Authorization: API_Key'
import requests
url = 'https://api.cookie-api.com/api/api-key'headers = {'Authorization': 'API_Key'}
response = requests.get(url, headers=headers)print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.cookie-api.com/api/api-key';
fetch(url, { method: 'GET', headers: { 'Authorization': 'API_Key' }}).then(response => response.json()).then(data => console.log(data)).catch(error => console.error('Error:', error));
package main
import ( "fmt" "log" "net/http" "io/ioutil")
func main() { url := "https://api.cookie-api.com/api/api-key" req, err := http.NewRequest("GET", url, nil) if err != nil { log.Fatal(err) } req.Header.Add("Authorization", "API_Key")
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatal(err) }
fmt.Println(string(body))}
const https = require('https');
const options = { hostname: 'api.cookie-api.com', path: '/api/api-key', method: 'GET', headers: { 'Authorization': 'API_Key' }};
const req = https.request(options, (res) => { let data = '';
res.on('data', (chunk) => { data += chunk; });
res.on('end', () => { console.log(JSON.parse(data)); });});
req.on('error', (e) => { console.error(e);});
req.end();
require 'net/http'require 'json'require 'uri'
uri = URI.parse("https://api.cookie-api.com/api/api-key")request = Net::HTTP::Get.new(uri)request["Authorization"] = "API_Key"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request)}
puts JSON.parse(response.body)
use reqwest::header::HeaderMap;use reqwest::blocking::Client;
fn main() { let url = "https://api.cookie-api.com/api/api-key"; let mut headers = HeaderMap::new(); headers.insert("Authorization", "API_Key".parse().unwrap());
let client = Client::new(); let res = client.get(url).headers(headers).send().unwrap();
println!("{}", res.text().unwrap());}
Authorizations | |
---|---|
Authorization String Required | <API_Key> |
curl --location 'https://api.cookie-api.com/api/api-key?Authroization=API_Key'
import requests
url = 'https://api.cookie-api.com/api/api-key?Authroization=API_Key'response = requests.get(url)print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.cookie-api.com/api/api-key?Authroization=API_Key';
fetch(url) .then(res => res.json()) .then(data => console.log(data)) .catch(err => console.error(err));
package main
import ( "fmt" "io/ioutil" "net/http")
func main() { url := "https://api.cookie-api.com/api/api-key?Authroization=API_Key" resp, err := http.Get(url) if err != nil { panic(err) } defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body))}
const https = require('https');
const options = { hostname: 'api.cookie-api.com', path: '/api/api-key?Authroization=API_Key', method: 'GET'};
const req = https.request(options, res => { let data = ''; res.on('data', chunk => { data += chunk; }); res.on('end', () => { console.log(JSON.parse(data)); });});
req.on('error', error => { console.error(error);});
req.end();
{ "Hint": "You will get your API Key from our dashboard (https://dashboard.cookie-api.com/). For more Information please view: https://docs.cookie-api.com/faq/api-key", "message": "Missing API key", "success": false}
Rate Limits
To ensure fair usage, the Cookie API imposes rate limits. Each account is allowed 80 requests per minute. If you exceed this limit, you will receive a 429 Too Many Requests
response.
{ "message": "Requests limit reached. Please try again later.", "resets_in": "55", "success": false}
Error Handling
The Cookie API uses standard HTTP status codes to indicate the success or failure of an API request. Here are some common status codes:
HTTP Status Code Summary | ||
---|---|---|
200 | OK | The request was successful. |
400 | Bad Request | The request was invalid or cannot be otherwise served. |
401 | Unauthorize | Missing or Invalid API Key. |
404 | Not Found | The requested resource could not be found. |
500 | Internal Server Error | Something went really wrong. (Report it in the Discord Server) |
502 | Bad Gateway | Usually happens when the server restarted or is restarting. |
402 | Payment Required | Premium is required to able to use this feature |
For all Possible errors along with a detailed description and a way on how to resolve it, you will find on our Status Codes FAQ Page below:
Badges
Badges Summary | |
---|---|
WIP | Work in Progress, Feature is currently in the works, no exact eta when it will come. |
Depracted | This feature will still be hosted but no longer updated. |
Offline | Feature was taken offline for update or maintanace, no exact eta when it would come back online |
Planned | Feature is on our plan, but no exact eta will be announced |
Paid / Premium | Feature requires payment to be able to be used |
Support
If you need further assistance, join our Discord Server to get help from our community and the Cookie API team. Our support team is active and ready to assist you with any issues you may face.