Index

hostedapi reference

Self-hosted REST API for downloads, search, tools, and local AI. All endpoints require an API key in the X-API-Key header.

auto_awesome

Getting started

Send your first request in under a minute. Hostedapi exposes a small surface across four categories and never charges per call.

hub

22 endpoints

Downloaders, search, tools, and local AI. Each is a single POST with JSON in and JSON out.

key

API key auth

Pass your key in the X-API-Key header. Generate, revoke, and rate-limit keys from the admin dashboard.

cached

Built in cache

Every download lands in a 1 hour cache. Search results stay fresh for 5 minutes. Reuse cache_id from a previous response and skip the upstream call entirely.

Authentication

Every request to hostedapi requires an API key. Pass it in the X-API-Key header. Keys are issued from the admin dashboard at /admin/ui.

first_request.sh
curl -X POST https://api.zeviltuff.biz.id/sc/brave \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q":"self hosted api"}'

Generating a key

Sign in to the admin dashboard and open the Keys tab. Each key can carry its own per minute rate limit. Disable or delete a key at any time without affecting other keys.

Rate limiting

Each key has its own token bucket. The default is 60 requests per minute. Configure per key from the admin dashboard.

Response headers

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 47
X-RateLimit-Reset: 1717500000

Error handling

Errors come back as JSON with a descriptive error field and an HTTP status code. The body shape is consistent across every endpoint.

{
  "error": "Invalid request body",
  "code": "VALIDATION_ERROR",
  "details": [
    { "path": "url", "message": "Required" }
  ]
}

Endpoints

Downloads

POST /dw/tiktok

Download a TikTok video without watermark

Request

{
  "url": "https://www.tiktok.com/@user/video/123"
}

Response

{ "cache_id": "01J...", "url": "https://cache..." }
POST /dw/tiktok/audio

Download TikTok audio track

Request

{
  "url": "https://www.tiktok.com/@user/video/123"
}

Response

{ "cache_id": "01J...", "url": "https://cache..." }
POST /dw/youtube

Download YouTube video or audio

Request

{
  "url": "https://youtu.be/dQw4w9WgXcQ",
  "format": "mp4"
}

Response

{ "cache_id": "01J...", "url": "https://cache..." }
POST /dw/github

Download a GitHub archive or release asset

Request

{
  "repo": "owner/name",
  "type": "archive"
}

Response

{ "cache_id": "01J...", "url": "https://cache..." }
POST /dw/facebook

Download a Facebook video

Request

{
  "url": "https://facebook.com/..."
}

Response

{ "cache_id": "01J...", "url": "https://cache..." }
POST /dw/instagram

Download an Instagram post

Request

{
  "url": "https://instagram.com/p/..."
}

Response

{ "cache_id": "01J...", "url": "https://cache..." }
POST /dw/twitter

Download Twitter media

Request

{
  "url": "https://twitter.com/user/status/123"
}

Response

{ "cache_id": "01J...", "url": "https://cache..." }
POST /dw/soundcloud

Download a SoundCloud track

Request

{
  "url": "https://soundcloud.com/artist/track"
}

Response

{ "cache_id": "01J...", "url": "https://cache..." }
POST /dw/spotify

Download a Spotify track

Request

{
  "url": "https://open.spotify.com/track/..."
}

Response

{ "cache_id": "01J...", "url": "https://cache..." }

Search

POST /sc/brave

Web search using Brave

Request

{
  "q": "self hosted api"
}

Response

{ "results": [{ "title": "...", "url": "...", "snippet": "..." }] }
POST /sc/google

Web search using Google

Request

{
  "q": "self hosted api"
}

Response

{ "results": [{ "title": "...", "url": "...", "snippet": "..." }] }
POST /sc/youtube

Search YouTube videos

Request

{
  "q": "lofi music"
}

Response

{ "results": [{ "title": "...", "channel": "...", "url": "..." }] }
POST /sc/pinterest

Search Pinterest pins

Request

{
  "q": "minimalist wallpaper"
}

Response

{ "results": [{ "title": "...", "image": "..." }] }
POST /sc/spotify

Search Spotify catalog

Request

{
  "q": "lofi beats"
}

Response

{ "results": [{ "title": "...", "artist": "...", "url": "..." }] }
POST /sc/image

Image web search

Request

{
  "q": "sunset photography"
}

Response

{ "results": [{ "title": "...", "image": "...", "source": "..." }] }
POST /sc/video

Video web search

Request

{
  "q": "surfing"
}

Response

{ "results": [{ "title": "...", "video": "..." }] }
POST /sc/audio

Audio web search

Request

{
  "q": "ambient"
}

Response

{ "results": [{ "title": "...", "audio": "..." }] }

Tools

POST /tl/translate

Translate text between languages

Request

{
  "text": "Hello world",
  "from": "en",
  "to": "es"
}

Response

{ "translated": "Hola mundo" }
POST /tl/subdomain

Find subdomains for a domain

Request

{
  "domain": "example.com"
}

Response

{ "subdomains": ["www.example.com", "api.example.com"] }
POST /tl/countryinfo

Get country information

Request

{
  "code": "ID"
}

Response

{ "name": "Indonesia", "capital": "Jakarta", "region": "Asia" }

AI

POST /ai/chat

Chat with local LLM

Request

{
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ]
}

Response

{ "message": { "role": "assistant", "content": "..." } }
POST /ai/img

Generate image from text prompt

Request

{
  "prompt": "a cat in space",
  "steps": 4
}

Response

{ "cache_id": "01J...", "url": "https://cache..." }

Cache

Every download and image response carries a cache_id. Fetch it through the cache endpoint to stream the cached file or inspect its metadata.

GET

/cache/:id

Stream the cached file with the original Content-Type.

GET

/cache/:id/info

Return JSON metadata for a cache entry: size, content type, expiry.

SDKs

Hostedapi speaks plain HTTP. Use any language that can send a request. Drop the snippet into a project and replace the key.

code node.mjs
const r = await fetch("https://api.zeviltuff.biz.id/sc/brave", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.HOSTEDAPI_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ q: "self hosted api" }),
});
const data = await r.json();
console.log(data);
code python.py
import os, requests
r = requests.post(
  "https://api.zeviltuff.biz.id/sc/brave",
  headers={"X-API-Key": os.environ["HOSTEDAPI_KEY"]},
  json={"q": "self hosted api"},
)
print(r.json())