JavaScript SDK Reference
Construct a client with new Scavio(config). Every platform is a namespace on the client, and each method returns the parsed JSON response.
Client
JavaScript
import { Scavio } from "scavio";
const client = new Scavio({
apiKey: "sk_live_your_key", // or SCAVIO_API_KEY env var
timeout: 30000,
maxRetries: 2,
});| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | SCAVIO_API_KEY | Your API key. Falls back to the environment variable. |
baseUrl | string | https://api.scavio.dev | API base URL. |
timeout | number | 30000 | Per-request timeout in milliseconds. |
maxRetries | number | 2 | Automatic retries for 429/5xx and network errors. |
Namespaces
Methods take a single options object and return Promise<Record<string, unknown>>.
| Namespace | Example methods |
|---|---|
client.google | search, aiMode, mapsSearch, mapsPlace, mapsReviews, shopping, flights, hotels, news, trends |
client.youtube | search, metadata |
client.amazon | search, product |
client.walmart | search, product |
client.reddit | search, post |
client.tiktok | searchVideos, profile, video, hashtag |
client.instagram | profile, userPosts, userReels, searchUsers |
Errors
Failed requests reject with a ScavioError. See Errors for status codes and the error body shape.