Text Analyzer
Analizes a given Text
POST /api/text/text-analyzer
https://api.cookie-api.com/api/text/text-analyzer
Authentication Learn how to get your API Key and use it in your requests!
{ "text": "The text to be analyzed (Max. 10.000 Characters)",}
curl --location 'https://api.cookie-api.com/api/text/text-analyzer' \--header 'Authorization: API_Key' \--header 'Content-Type: application/json' \--data '{ "text": "The kitchen is alive with warmth as cookies bake in the oven, filling the air with a deliciously sweet aroma. Laughter echoes as golden treats, still soft and gooey, are pulled from the tray. Each bite is a perfect balance of crispy edges and melty chocolate chips, a reminder of simple, joyful moments. The cookie jar is soon brimming, each one a little piece of happiness. With every shared smile and cookie, the day feels brighter, sweeter, and filled with love that lingers long after the last crumb is gone."}'
import requestsimport json
url = 'https://api.cookie-api.com/api/text/text-analyzer'headers = { 'Authorization': 'API_Key', 'Content-Type': 'application/json'}
data = { 'text': "The kitchen is alive with warmth as cookies bake in the oven, filling the air with a deliciously sweet aroma. Laughter echoes as golden treats, still soft and gooey, are pulled from the tray. Each bite is a perfect balance of crispy edges and melty chocolate chips, a reminder of simple, joyful moments. The cookie jar is soon brimming, each one a little piece of happiness. With every shared smile and cookie, the day feels brighter, sweeter, and filled with love that lingers long after the last crumb is gone."}
response = requests.post(url, headers=headers, json=data)print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.cookie-api.com/api/text/text-analyzer';const headers = { 'Authorization': 'API_Key', 'Content-Type': 'application/json'};
const data = { text: "The kitchen is alive with warmth as cookies bake in the oven, filling the air with a deliciously sweet aroma. Laughter echoes as golden treats, still soft and gooey, are pulled from the tray. Each bite is a perfect balance of crispy edges and melty chocolate chips, a reminder of simple, joyful moments. The cookie jar is soon brimming, each one a little piece of happiness. With every shared smile and cookie, the day feels brighter, sweeter, and filled with love that lingers long after the last crumb is gone."};
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/text/text-analyzer" data := map[string]string{ "text": "The kitchen is alive with warmth as cookies bake in the oven, filling the air with a deliciously sweet aroma. Laughter echoes as golden treats, still soft and gooey, are pulled from the tray. Each bite is a perfect balance of crispy edges and melty chocolate chips, a reminder of simple, joyful moments. The cookie jar is soon brimming, each one a little piece of happiness. With every shared smile and cookie, the day feels brighter, sweeter, and filled with love that lingers long after the last crumb is gone.", } 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({ text: "The kitchen is alive with warmth as cookies bake in the oven, filling the air with a deliciously sweet aroma. Laughter echoes as golden treats, still soft and gooey, are pulled from the tray. Each bite is a perfect balance of crispy edges and melty chocolate chips, a reminder of simple, joyful moments. The cookie jar is soon brimming, each one a little piece of happiness. With every shared smile and cookie, the day feels brighter, sweeter, and filled with love that lingers long after the last crumb is gone."});
const options = { hostname: 'api.cookie-api.com', path: '/api/text/text-analyzer', 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/text/text-analyzer')request = Net::HTTP::Post.new(url)request['Authorization'] = 'API_Key'request['Content-Type'] = 'application/json'request.body = { text: "The kitchen is alive with warmth as cookies bake in the oven, filling the air with a deliciously sweet aroma. Laughter echoes as golden treats, still soft and gooey, are pulled from the tray. Each bite is a perfect balance of crispy edges and melty chocolate chips, a reminder of simple, joyful moments. The cookie jar is soon brimming, each one a little piece of happiness. With every shared smile and cookie, the day feels brighter, sweeter, and filled with love that lingers long after the last crumb is gone."}.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};use serde_json::Value;
#[derive(Serialize, Deserialize)]struct TextAnalyzerRequest { text: String,}
fn main() { let url = "https://api.cookie-api.com/api/text/text-analyzer"; let client = Client::new(); let mut headers = HeaderMap::new(); headers.insert("Authorization", "API_Key".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let request_body = TextAnalyzerRequest { text: "The kitchen is alive with warmth as cookies bake in the oven, filling the air with a deliciously sweet aroma. Laughter echoes as golden treats, still soft and gooey, are pulled from the tray. Each bite is a perfect balance of crispy edges and melty chocolate chips, a reminder of simple, joyful moments. The cookie jar is soon brimming, each one a little piece of happiness. With every shared smile and cookie, the day feels brighter, sweeter, and filled with love that lingers long after the last crumb is gone.".to_string(), };
let res = client .post(url) .headers(headers) .json(&request_body) .send() .unwrap();
let json: Value = res.json().unwrap(); println!("{:#?}", json);}
Responses
{ "average_word_length": 4.7, "charachter_count": 512, "digits_count": 0, "letter_counts": { "a": 32, "b": 6, "c": 16, "d": 12, "e": 59, "f": 11, "g": 10, "h": 23, "i": 34, "j": 2, "k": 5, "l": 26, "m": 12, "n": 19, "o": 28, "p": 8, "q": 0, "r": 22, "s": 27, "t": 33, "u": 5, "v": 4, "w": 7, "x": 0, "y": 8, "z": 0 }, "longest_word": "deliciously", "lowercase_count": 404, "punctuation_details": { "!": 0, "\"": 0, "#": 0, "$": 0, "%": 0, "&": 0, "'": 0, "(": 0, ")": 0, "*": 0, "+": 0, ",": 9, "-": 0, ".": 5, "/": 0, ":": 0, ";": 0, "<": 0, "=": 0, ">": 0, "?": 0, "@": 0, "[": 0, "\\": 0, "]": 0, "^": 0, "_": 0, "`": 0, "{": 0, "|": 0, "}": 0, "~": 0 }, "shortest_word": "a", "skipped_characters": 14, "total_characters": 512, "total_sentences": 5, "total_words": 90, "unique_words_count": 71, "uppercase_count": 5, "whitespace_count": 89}