Asad Tools
DEVELOPER API

Asad Tools Developer API

Base URL: https://api-asad-tools.vercel.app. These are the tool endpoints that require an x-api-key. Sign up for a free account to get your key automatically.

Quick Start

Every Developer API call is a POST request with a JSON body and your API key in the header.

  1. Get your API keySign up free, then open the API Keys tab in your dashboard. Copy the tn_live_… key.
  2. Choose an endpointPOST /tools/uid (profile ID lookup), POST /tools/fonts (stylish fonts), POST /tools/video-download (video links), POST /tools/ai-chat (AI answers).
  3. Send the request — set Content-Type: application/json and x-api-key: YOUR_KEY, then POST your JSON body.

Minimal working example (cURL):

curl -X POST https://api-asad-tools.vercel.app/tools/fonts \
  -H "Content-Type: application/json" \
  -H "x-api-key: tn_live_YOUR_API_KEY" \
  -d '{"text":"hello"}'

A successful call returns {"success": true, ...}. If you see 401 invalid_api_key, double-check the key. If you see 429 rate_limited, slow your requests or upgrade your plan.

Authentication

Every account automatically receives one API key on signup, visible in your dashboard's API Keys tab. Send it with every request using either header:

Authorization: Bearer tn_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# or
x-api-key: tn_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Requests without a valid key are rejected with 401 Unauthorized.

Headers

HeaderRequiredDescription
Authorization or x-api-keyYesYour API key, either format accepted.
Content-TypeYes (POST)Must be application/json.

POST/tools/uid

Resolves a public profile URL or username to its numeric account ID. Supports Facebook, Instagram, TikTok and Free Fire.

Request body

{
  "platform": "facebook",   // "facebook" | "instagram" | "tiktok" | "freefire"
  "input": "zuck"           // username or full profile URL
}

Response — 200 OK

{
  "success": true,
  "result": {
    "found": true,
    "uid": "4",
    "platform": "facebook",
    "source_url": "https://www.facebook.com/zuck"
  }
}

Method: POST  |  Auth: x-api-key required

POST/tools/fonts

Converts text into multiple unicode font styles.

Request body

{
  "text": "hello"   // max 500 characters
}

Response — 200 OK

{
  "success": true,
  "input": "hello",
  "fonts": [
    { "style": "bold", "label": "Bold", "result": "𝐡𝐞𝐥𝐥𝐨" },
    { "style": "italic", "label": "Italic", "result": "𝘩𝘦𝘭𝘭𝘰" }
  ]
}

Method: POST  |  Auth: x-api-key required

POST/tools/video-download

Resolves a public video URL into direct download links for every available quality. Supports TikTok, YouTube, Facebook, Instagram and Twitter/X. Also returns the title and thumbnail so you can build a preview.

Requirements

FieldTypeRequiredDescription
urlstringYesFull public video URL, must start with http:// or https://. Max 2048 characters.

Request body

{
  "url": "https://www.tiktok.com/@username/video/7301234567890123456"
}

Example command

curl -X POST https://api-asad-tools.vercel.app/tools/video-download \
  -H "Content-Type: application/json" \
  -H "x-api-key: tn_live_YOUR_API_KEY" \
  -d '{"url":"https://www.tiktok.com/@username/video/7301234567890123456"}'

Response — 200 OK

{
  "success": true,
  "platform": "tiktok",
  "title": "Sunset timelapse",
  "thumbnail": "https://p16-sign.tiktokcdn.com/....jpeg",
  "links": [
    { "quality": "HD (no watermark)", "type": "video", "ext": "mp4", "url": "https://....mp4" },
    { "quality": "SD (no watermark)", "type": "video", "ext": "mp4", "url": "https://....mp4" },
    { "quality": "Audio",             "type": "audio", "ext": "mp3", "url": "https://....mp3" }
  ]
}

Errors400 missing_url, 400 invalid_url, 400 url_too_long, 422 unsupported_platform, 422 no_links_found.

Method: POST (a GET with ?url= also works)  |  Auth: x-api-key required

POST/tools/ai-chat

Sends a message to ToolBot and returns the complete answer. Pass the returned chat_id back on the next call to keep conversation context. The assistant always replies in the same language the user wrote in.

Requirements

FieldTypeRequiredDescription
messagestringYesThe user prompt. 1–2000 characters.
chat_idstringNoID returned by a previous call — include it to continue the same conversation.

Request body

{
  "message": "Write a JavaScript function that reverses a string",
  "chat_id": null
}

Example command

curl -X POST https://api-asad-tools.vercel.app/tools/ai-chat \
  -H "Content-Type: application/json" \
  -H "x-api-key: tn_live_YOUR_API_KEY" \
  -d '{"message":"Write a JavaScript function that reverses a string"}'

Response — 200 OK

{
  "success": true,
  "answer": "Here you go:\n\nfunction reverse(str) {\n  return str.split('').reverse().join('');\n}",
  "chat_id": "c_9f2a41be7d"
}

Errors400 missing_message, 400 empty_message, 400 message_too_long, 502 ai_upstream_error.

Method: POST  |  Auth: x-api-key required

POST/public/media-search

Searches free stock photos and videos from Pexels through Asad Tools. The Pexels key is held server-side, so nothing is exposed in the browser. This endpoint powers the Stock Media section on the homepage and is site-origin only — no API key, but it only answers requests coming from the Asad Tools website. GET with query-string parameters works identically.

Requirements

FieldTypeRequiredDescription
querystringYesWhat to search for. 1–120 characters.
typestringNoimage (default) or video.
pagenumberNoPage number, 1–100. Default 1.
per_pagenumberNoResults per page, 1–40. Default 24.
orientationstringNolandscape, portrait or square.

Request body

{
  "query": "mountains",
  "type": "image",
  "page": 1,
  "per_page": 24,
  "orientation": "landscape"
}

Example command

curl -X POST https://api-asad-tools.vercel.app/api/public/media-search \
  -H "Content-Type: application/json" \
  -H "Origin: https://asad-tools.vercel.app" \
  -d '{"query":"mountains","type":"image"}'

Response — 200 OK

{
  "success": true,
  "type": "image",
  "query": "mountains",
  "page": 1,
  "per_page": 24,
  "total_results": 8000,
  "has_more": true,
  "results": [
    {
      "id": 417074,
      "type": "image",
      "title": "Landscape photo of mountains",
      "width": 6000,
      "height": 4000,
      "thumb": "https://images.pexels.com/photos/417074/...&w=350",
      "preview": "https://images.pexels.com/photos/417074/...&w=940",
      "download": "https://images.pexels.com/photos/417074/pexels-photo-417074.jpeg",
      "page": "https://www.pexels.com/photo/417074/",
      "photographer": "James Wheeler",
      "photographer_url": "https://www.pexels.com/@souvenirpixels",
      "avg_color": "#6A7B8A"
    }
  ],
  "provider": "Pexels",
  "provider_url": "https://www.pexels.com"
}

When type is video, each result also includes duration (seconds) and a qualities array of downloadable files (quality, width, height, file_type, link) sorted from highest to lowest resolution.

Errors400 missing_query, 400 query_too_long, 403 forbidden_origin, 429 rate_limited, 500 missing_api_key, 502 provider_error.

Method: POST or GET  |  Auth: none (site origin only)  |  Server env: PEXELS_API_KEY

Free Website Widgets

The following tools are also available on the website as free public widgets. They do not require an API key — they only work when called from the Asad Tools website itself:

  • POST /public/uid — free UID lookup widget
  • POST /public/fonts — free stylish font widget
  • POST /public/video-download — video downloader widget
  • POST /public/media-search — stock image & video search widget
  • POST /public/ai-chat — free AI chat widget

These are not part of the Developer API because they do not use x-api-key authentication.

Error Codes

StatusCodeMeaning
400missing_fieldsRequired body fields were not provided.
400missing_textFont endpoint: "text" is required.
400text_too_longInput exceeded the maximum length.
401missing_api_keyNo API key was sent.
401invalid_api_keyThe key doesn't match any account.
403revoked_api_keyThe key was regenerated/revoked.
404id_not_foundUID couldn't be resolved from the public page.
400missing_urlVideo downloader: "url" is required.
400invalid_urlURL must start with http:// or https://.
400missing_messageAI chat: "message" is required.
400message_too_longAI chat: message exceeded 2000 characters.
422unsupported_platformVideo URL is not from a supported platform.
422no_links_foundVideo is private, geo-blocked or has no extractable links.
502ai_upstream_errorAI service is temporarily unavailable.
429rate_limitedToo many requests — see rate limits below.
500internal_errorSomething went wrong on our end.

All errors follow the same shape:

{
  "success": false,
  "error": { "code": "invalid_api_key", "message": "The API key provided is not valid." }
}

Rate Limits

Free-plan keys are limited to 60 requests per minute and 5,000 requests per month. Current usage is always visible in your dashboard's Usage tab. Need more? Contact us about higher-volume plans.

Code Examples

# UID Lookup
curl -X POST https://api-asad-tools.vercel.app/tools/uid \
  -H "Content-Type: application/json" \
  -H "x-api-key: tn_live_YOUR_API_KEY" \
  -d '{"platform":"instagram","input":"cristiano"}'

# Font Generator
curl -X POST https://api-asad-tools.vercel.app/tools/fonts \
  -H "Content-Type: application/json" \
  -H "x-api-key: tn_live_YOUR_API_KEY" \
  -d '{"text":"hello"}'

# Video Downloader
curl -X POST https://api-asad-tools.vercel.app/tools/video-download \
  -H "Content-Type: application/json" \
  -H "x-api-key: tn_live_YOUR_API_KEY" \
  -d '{"url":"https://www.tiktok.com/@username/video/7301234567890123456"}'

# AI Chat
curl -X POST https://api-asad-tools.vercel.app/tools/ai-chat \
  -H "Content-Type: application/json" \
  -H "x-api-key: tn_live_YOUR_API_KEY" \
  -d '{"message":"Explain async/await in one paragraph"}'
fetch("https://api-asad-tools.vercel.app/tools/uid", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": "tn_live_YOUR_API_KEY"
  },
  body: JSON.stringify({ platform: "instagram", input: "cristiano" })
})
  .then(res => res.json())
  .then(data => console.log(data));

// AI Chat
fetch("https://api-asad-tools.vercel.app/tools/ai-chat", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": "tn_live_YOUR_API_KEY"
  },
  body: JSON.stringify({ message: "Hello!" })
})
  .then(res => res.json())
  .then(data => console.log(data.answer));
import requests

res = requests.post(
    "https://api-asad-tools.vercel.app/tools/uid",
    headers={"x-api-key": "tn_live_YOUR_API_KEY"},
    json={"platform": "instagram", "input": "cristiano"},
)
print(res.json())

# Video Downloader
res = requests.post(
    "https://api-asad-tools.vercel.app/tools/video-download",
    headers={"x-api-key": "tn_live_YOUR_API_KEY"},
    json={"url": "https://www.tiktok.com/@username/video/7301234567890123456"},
)
for link in res.json()["links"]:
    print(link["quality"], link["url"])
const res = await fetch("https://api-asad-tools.vercel.app/tools/fonts", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": "tn_live_YOUR_API_KEY"
  },
  body: JSON.stringify({ text: "hello" })
});
const data = await res.json();
console.log(data);

// Video Downloader
const vid = await fetch("https://api-asad-tools.vercel.app/tools/video-download", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": "tn_live_YOUR_API_KEY"
  },
  body: JSON.stringify({ url: "https://youtu.be/dQw4w9WgXcQ" })
});
console.log((await vid.json()).links);
<?php
$ch = curl_init("https://api-asad-tools.vercel.app/tools/uid");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "x-api-key: tn_live_YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["platform" => "instagram", "input" => "cristiano"]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;