QR Code generator
Generates a QR Code
POST /api/images/qr-code
https://api.cookie-api.com/api/images/qr-code
Authentication Learn how to get your API Key and use it in your requests!
{ "data": "content", "style": "dots/standart", //optional "border": "Border size of the QR Code", //optional "center_image_url": "url" //optional}
curl --location 'https://api.cookie-api.com/api/images/qr-code' \--header 'Authorization: API_Key' \--header 'Content-Type: application/json' \--data '{"data": "https://www.cookie-api.com", "style": "dots","center_image_url": "https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpsg", "border": "4"}'
import requests
url = 'https://api.cookie-api.com/api/images/qr-code'headers = { 'Authorization': 'API_Key', 'Content-Type': 'application/json'}
data = { 'data': 'https://www.cookie-api.com', 'style': 'dots', 'center_image_url': 'https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpsg', 'border': '4'}
response = requests.post(url, headers=headers, json=data)print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.cookie-api.com/api/images/qr-code';const headers = { 'Authorization': 'API_Key', 'Content-Type': 'application/json'};
const data = { data: 'https://www.cookie-api.com', style: 'dots', center_image_url: 'https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpsg', border: '4'};
fetch(url, { method: 'POST', headers, body: JSON.stringify(data)}).then(res => res.json()).then(data => console.log(data)).catch(err => console.error(err));
package main
import ( "bytes" "encoding/json" "fmt" "log" "net/http")
func main() { url := "https://api.cookie-api.com/api/images/qr-code" data := map[string]interface{}{ "data": "https://www.cookie-api.com", "style": "dots", "center_image_url": "https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpsg", "border": "4", } jsonData, err := json.Marshal(data) if err != nil { log.Fatal(err) }
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) if err != nil { log.Fatal(err) }
req.Header.Set("Authorization", "API_Key") req.Header.Set("Content-Type", "application/json")
client := &http.Client{} resp, err := client.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)}
const https = require('https');
const data = JSON.stringify({ data: 'https://www.cookie-api.com', style: 'dots', center_image_url: 'https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpsg', border: '4'});
const options = { hostname: 'api.cookie-api.com', path: '/api/images/qr-code', method: 'POST', headers: { 'Authorization': 'API_Key', 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(data) }};
const req = https.request(options, res => { let responseData = ''; res.on('data', chunk => { responseData += chunk; }); res.on('end', () => { console.log(JSON.parse(responseData)); });});
req.on('error', error => { console.error(error);});
req.write(data);req.end();
require 'net/http'require 'json'require 'uri'
url = URI.parse('https://api.cookie-api.com/api/images/qr-code')request = Net::HTTP::Post.new(url)request['Authorization'] = 'API_Key'request['Content-Type'] = 'application/json'request.body = { data: "https://www.cookie-api.com", style: "dots", center_image_url: "https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpsg", border: "4"}.to_json
response = Net::HTTP.start(url.hostname, url.port, use_ssl: true) do |http| http.request(request)end
puts JSON.parse(response.body)
use reqwest::blocking::Client;use reqwest::header::HeaderMap;use serde::{Deserialize, Serialize};
#[derive(Serialize)]struct QRCodeRequest { data: String, style: String, center_image_url: String, border: String,}
fn main() { let url = "https://api.cookie-api.com/api/images/qr-code"; let client = Client::new(); let mut headers = HeaderMap::new(); headers.insert("Authorization", "API_Key".parse().unwrap());
let request_body = QRCodeRequest { data: "https://www.cookie-api.com".to_string(), style: "dots".to_string(), center_image_url: "https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpsg".to_string(), border: "4".to_string(), };
let res = client .post(url) .headers(headers) .json(&request_body) .send() .unwrap();
println!("{}", res.text().unwrap());}
Responses
{ "success": true, "url": "https://images.cookie-api.com/qr-codes/2f4cea35-6a30-41c9-98c7-ba183d850812.png"}