API Key
Tento obsah zatím není dostupný ve vašem jazyce.
Where do I get an API Key?
Section titled “Where do I get an API Key?”You can get an API Key on the Dashboard.
How do I regenerate my API Key?
Section titled “How do I regenerate my API Key?”You can regenerate your API key from the Dashboard. Navigate to the API key section and click on “Regenerate”.
What should i do if my API Key got leaked?
Section titled “What should i do if my API Key got leaked?”We strongly recommend to regenerate your API Key if you think that it got leaked.
Where should i Include my API Key?
Section titled “Where should i Include my API Key?”You can include your API key in the URL parameters or the request headers of each request. Here’s how it can be formatted:
For security reasons, we recommend using the API key in the request headers.
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?Authorization=API_Key'
import requests
url = 'https://api.cookie-api.com/api/api-key?Authorization=API_Key'response = requests.get(url)print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.cookie-api.com/api/api-key?Authorization=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?Authorization=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?Authorization=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/en/docs/getting-started/faq/api-key/", "message": "Missing API key", "success": false}