# YepAPI — Full Documentation > This is the complete YepAPI documentation concatenated into a single file for AI consumption. --- ## Cursor & Claude Setup *Source: ai-agents/cursor-claude.mdx* ## AI-First Documentation YepAPI is designed to work seamlessly with AI coding assistants. We provide machine-readable documentation at: - **`/llms.txt`** — Condensed API reference for AI context windows - **`/llms-full.txt`** — Complete documentation in one file ## Using with Cursor Point Cursor to our docs by adding this to your project's `.cursorrules`: ```text When using YepAPI, reference https://docs.yepapi.com/llms.txt for the API specification. All requests use x-api-key header auth. Check the `ok` boolean before accessing `data`. ``` Or paste the usage pattern directly: ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/keywords', { method: 'POST', headers: { 'x-api-key': process.env.YEP_API_KEY!, 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords: ['your keyword'] }), }); const { ok, data, error } = await res.json(); ``` ## Using with Claude Share the llms.txt URL with Claude: ```text I'm using YepAPI. Here's the API reference: https://docs.yepapi.com/llms.txt Help me get keyword data for "nextjs seo" and "react frameworks". ``` ## Using the MCP Server The YepAPI MCP Server lets Claude Desktop and other MCP clients call YepAPI endpoints directly. See the [MCP Server](/ai-agents/mcp-server) page for setup instructions. --- ## LangChain & Vercel AI SDK *Source: ai-agents/langchain.mdx* ## Vercel AI SDK Use YepAPI as a tool in the Vercel AI SDK: ```typescript import { generateText, tool } from 'ai'; import { z } from 'zod'; const result = await generateText({ model: yourModel, tools: { getKeywords: tool({ description: 'Get SEO keyword data including search volume and difficulty', parameters: z.object({ keywords: z.array(z.string()), }), execute: async ({ keywords }) => { const res = await fetch('https://api.yepapi.com/v1/seo/keywords', { method: 'POST', headers: { 'x-api-key': process.env.YEP_API_KEY!, 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords }), }); const { data } = await res.json(); return data; }, }), }, prompt: 'Research SEO keywords for "nextjs tutorial"', }); ``` ## LangChain ```typescript import { DynamicStructuredTool } from '@langchain/core/tools'; import { z } from 'zod'; const keywordTool = new DynamicStructuredTool({ name: 'seo_keywords', description: 'Get SEO keyword data', schema: z.object({ keywords: z.array(z.string()), }), func: async ({ keywords }) => { const res = await fetch('https://api.yepapi.com/v1/seo/keywords', { method: 'POST', headers: { 'x-api-key': process.env.YEP_API_KEY!, 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords }), }); const { data } = await res.json(); return JSON.stringify(data); }, }); ``` ## OpenAI Function Calling Use our OpenAPI spec for automatic function schema generation: ```typescript const response = await openai.chat.completions.create({ model: 'gpt-4', messages: [{ role: 'user', content: 'Get keyword data for nextjs' }], functions: [{ name: 'seo_keywords', description: 'Get keyword search volume and difficulty', parameters: { type: 'object', properties: { keywords: { type: 'array', items: { type: 'string' } }, location: { type: 'string', default: 'us' }, }, required: ['keywords'], }, }], }); ``` > Download the full OpenAPI spec at [/openapi.json](/openapi.json) for automatic tool schema generation. --- ## MCP Server *Source: ai-agents/mcp-server.mdx* ## What is MCP? The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) lets AI assistants like Claude call external tools directly. The YepAPI MCP server exposes all 40+ endpoints as callable tools. ## Installation ```bash npm install -g @yepapi/mcp ``` ## Claude Desktop Configuration Add this to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`): ```json { "mcpServers": { "yepapi": { "command": "npx", "args": ["-y", "@yepapi/mcp"], "env": { "YEP_API_KEY": "yep_sk_your_key_here" } } } } ``` Restart Claude Desktop. You'll see YepAPI tools available in the tools menu. ## Available Tools The MCP server exposes these tools: | Tool | Description | | :--- | :---------- | | `seo_keywords` | Get search volume, CPC, difficulty for keywords | | `seo_serp` | Analyze SERP results for a query | | `seo_domain_overview` | Get domain metrics (DA, traffic, backlinks) | | `seo_content_score` | Score content for SEO quality | | `ai_visibility` | Track brand mentions across AI engines | | `scrape` | Scrape any URL to markdown or HTML | | `scrape_stealth` | Stealth scrape with premium proxies | | `scrape_ai_extract` | AI-powered data extraction from URLs | | `tools_qr` | Generate QR codes | | `tools_pdf` | Generate PDFs from HTML | | `tools_whois` | WHOIS and DNS lookups | > Each tool call costs the same as the equivalent API call — you pay per use. --- ## Claude Haiku 4 *Source: ai-models/anthropic/claude-haiku-4.mdx* ## Overview Anthropic's fastest and most affordable model. Ideal for high-volume tasks, quick responses, and cost-sensitive applications with a 200K context window. | Property | Value | | :--- | :--- | | Model ID | `anthropic/claude-haiku-4` | | Context Window | 200,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.80 / 1M tokens | | Output Price | $4.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'anthropic/claude-haiku-4', messages: [{ role: 'user', content: 'Extract the product name and price from: The MacBook Air M3 starts at $1,099.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "anthropic/claude-haiku-4", "messages": [{"role": "user", "content": "Extract the product name and price from: The MacBook Air M3 starts at $1,099."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `anthropic/claude-haiku-4`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "anthropic/claude-haiku-4", "message": { "role": "assistant", "content": "Product: MacBook Air M3\nPrice: $1,099" }, "usage": { "promptTokens": 22, "completionTokens": 12, "totalTokens": 34 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Product"},"model":"anthropic/claude-haiku-4","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Claude Opus 4.6 Fast *Source: ai-models/anthropic/claude-opus-4.6-fast.mdx* ## Overview Anthropic's fastest Opus variant. Same intelligence as Opus 4.6 with faster output and 128K output tokens. | Property | Value | | :--- | :--- | | Model ID | `anthropic/claude-opus-4.6-fast` | | Context Window | 1,000,000 tokens | | Max Output | 128,000 tokens | | Input Price | $30.00 / 1M tokens | | Output Price | $150.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'anthropic/claude-opus-4.6-fast', messages: [{ role: 'user', content: 'Write a technical design document for a real-time collaborative editor.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "anthropic/claude-opus-4.6-fast", "messages": [{"role": "user", "content": "Write a technical design document for a real-time collaborative editor."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `anthropic/claude-opus-4.6-fast`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "anthropic/claude-opus-4.6-fast", "message": { "role": "assistant", "content": "# Real-Time Collaborative Editor — Technical Design Document\n\n## 1. Overview\nThis document outlines the architecture for a collaborative text editor using CRDTs for conflict-free concurrent editing across distributed clients." }, "usage": { "promptTokens": 15, "completionTokens": 1842, "totalTokens": 1857 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"#"},"model":"anthropic/claude-opus-4.6-fast","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Claude Opus 4.6 *Source: ai-models/anthropic/claude-opus-4.6.mdx* ## Overview Anthropic's most capable model. Best-in-class for complex analysis, nuanced writing, advanced coding, and multi-step agentic tasks with a 1M context window. | Property | Value | | :--- | :--- | | Model ID | `anthropic/claude-opus-4.6` | | Context Window | 1,000,000 tokens | | Max Output | 32,000 tokens | | Input Price | $5.00 / 1M tokens | | Output Price | $25.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'anthropic/claude-opus-4.6', messages: [{ role: 'user', content: 'Analyze the trade-offs between microservices and monolithic architecture.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "anthropic/claude-opus-4.6", "messages": [{"role": "user", "content": "Analyze the trade-offs between microservices and monolithic architecture."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `anthropic/claude-opus-4.6`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "anthropic/claude-opus-4.6", "message": { "role": "assistant", "content": "Microservices offer independent deployability and technology diversity but introduce distributed-system complexity, while monoliths provide simplicity and strong consistency at the cost of scaling flexibility." }, "usage": { "promptTokens": 16, "completionTokens": 245, "totalTokens": 261 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Microservices"},"model":"anthropic/claude-opus-4.6","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Claude Opus 4.7 *Source: ai-models/anthropic/claude-opus-4.7.mdx* ## Overview Anthropic's newest flagship. The most capable Claude yet for complex reasoning, agentic tool use, nuanced writing, and advanced coding — with a 1M token context window. | Property | Value | | :--- | :--- | | Model ID | `anthropic/claude-opus-4.7` | | Context Window | 1,000,000 tokens | | Max Output | 32,000 tokens | | Input Price | $5.00 / 1M tokens | | Output Price | $25.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'anthropic/claude-opus-4.7', messages: [{ role: 'user', content: 'Analyze the trade-offs between microservices and monolithic architecture.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "anthropic/claude-opus-4.7", "messages": [{"role": "user", "content": "Analyze the trade-offs between microservices and monolithic architecture."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `anthropic/claude-opus-4.7`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "anthropic/claude-opus-4.7", "message": { "role": "assistant", "content": "Microservices offer independent deployability and technology diversity but introduce distributed-system complexity, while monoliths provide simplicity and strong consistency at the cost of scaling flexibility." }, "usage": { "promptTokens": 16, "completionTokens": 245, "totalTokens": 261 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Microservices"},"model":"anthropic/claude-opus-4.7","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Claude Sonnet 4.5 *Source: ai-models/anthropic/claude-sonnet-4.5.mdx* ## Overview Anthropic's previous-generation Sonnet. Strong writing, coding, and analysis capabilities with a 1M context window. | Property | Value | | :--- | :--- | | Model ID | `anthropic/claude-sonnet-4.5` | | Context Window | 1,000,000 tokens | | Max Output | 16,384 tokens | | Input Price | $3.00 / 1M tokens | | Output Price | $15.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'anthropic/claude-sonnet-4.5', messages: [{ role: 'user', content: 'Explain the observer design pattern with a practical TypeScript example.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "anthropic/claude-sonnet-4.5", "messages": [{"role": "user", "content": "Explain the observer design pattern with a practical TypeScript example."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `anthropic/claude-sonnet-4.5`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "anthropic/claude-sonnet-4.5", "message": { "role": "assistant", "content": "The Observer pattern defines a one-to-many dependency where a subject notifies all registered observers when its state changes. Here's a practical TypeScript implementation using a typed event emitter..." }, "usage": { "promptTokens": 17, "completionTokens": 312, "totalTokens": 329 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"The"},"model":"anthropic/claude-sonnet-4.5","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Claude Sonnet 4.6 *Source: ai-models/anthropic/claude-sonnet-4.6.mdx* ## Overview Anthropic's latest balanced model. Excellent performance across writing, coding, and analysis with a 1M context window at a competitive price. | Property | Value | | :--- | :--- | | Model ID | `anthropic/claude-sonnet-4.6` | | Context Window | 1,000,000 tokens | | Max Output | 16,384 tokens | | Input Price | $3.00 / 1M tokens | | Output Price | $15.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'anthropic/claude-sonnet-4.6', messages: [{ role: 'user', content: 'Write a Python decorator that retries a function up to 3 times with exponential backoff.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "anthropic/claude-sonnet-4.6", "messages": [{"role": "user", "content": "Write a Python decorator that retries a function up to 3 times with exponential backoff."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `anthropic/claude-sonnet-4.6`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "anthropic/claude-sonnet-4.6", "message": { "role": "assistant", "content": "import time\nimport functools\n\ndef retry(max_retries=3, base_delay=1):\n def decorator(func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n for attempt in range(max_retries):\n try:\n return func(*args, **kwargs)\n except Exception as e:\n if attempt == max_retries - 1:\n raise\n time.sleep(base_delay * 2 ** attempt)\n return wrapper\n return decorator" }, "usage": { "promptTokens": 22, "completionTokens": 187, "totalTokens": 209 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"import"},"model":"anthropic/claude-sonnet-4.6","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Claude Sonnet 4 *Source: ai-models/anthropic/claude-sonnet-4.mdx* ## Overview Anthropic's balanced model. Excellent at writing, analysis, coding, and complex multi-step tasks with a massive 200K context window. | Property | Value | | :--- | :--- | | Model ID | `anthropic/claude-sonnet-4` | | Context Window | 200,000 tokens | | Max Output | 8,192 tokens | | Input Price | $3.00 / 1M tokens | | Output Price | $15.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'anthropic/claude-sonnet-4', messages: [{ role: 'user', content: 'Write a Python function that finds all prime numbers up to n.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "anthropic/claude-sonnet-4", "messages": [{"role": "user", "content": "Write a Python function that finds all prime numbers up to n."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `anthropic/claude-sonnet-4`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "anthropic/claude-sonnet-4", "message": { "role": "assistant", "content": "def sieve_of_eratosthenes(n: int) -> list[int]:\n \"\"\"Find all prime numbers up to n using the Sieve of Eratosthenes.\"\"\"\n ..." }, "usage": { "promptTokens": 18, "completionTokens": 156, "totalTokens": 174 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"def"},"model":"anthropic/claude-sonnet-4","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Seed 1.6 Flash *Source: ai-models/bytedance-seed/seed-1.6-flash.mdx* ## Overview ByteDance's fast budget model. Optimized for speed and cost efficiency with a 262K context window. | Property | Value | | :--- | :--- | | Model ID | `bytedance-seed/seed-1.6-flash` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.075 / 1M tokens | | Output Price | $0.30 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'bytedance-seed/seed-1.6-flash', messages: [{ role: 'user', content: "Extract the date and time from this text: 'The conference starts on March 15, 2025 at 9:00 AM.'" }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "bytedance-seed/seed-1.6-flash", "messages": [{"role": "user", "content": "Extract the date and time: The conference starts on March 15, 2025 at 9:00 AM."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `bytedance-seed/seed-1.6-flash`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "bytedance-seed/seed-1.6-flash", "message": { "role": "assistant", "content": "Date: March 15, 2025\nTime: 9:00 AM" }, "usage": { "promptTokens": 26, "completionTokens": 16, "totalTokens": 42 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Date"},"model":"bytedance-seed/seed-1.6-flash","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Seed 1.6 *Source: ai-models/bytedance-seed/seed-1.6.mdx* ## Overview ByteDance's previous generation model. Proven reliability with a 262K context window. | Property | Value | | :--- | :--- | | Model ID | `bytedance-seed/seed-1.6` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.25 / 1M tokens | | Output Price | $2.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'bytedance-seed/seed-1.6', messages: [{ role: 'user', content: 'Write a Python function that checks if a string is a valid palindrome.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "bytedance-seed/seed-1.6", "messages": [{"role": "user", "content": "Write a Python function that checks if a string is a valid palindrome."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `bytedance-seed/seed-1.6`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "bytedance-seed/seed-1.6", "message": { "role": "assistant", "content": "Here's a Python function that checks for palindromes by comparing the cleaned, lowercased string with its reverse:\n\ndef is_palindrome(s):\n cleaned = ''.join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]" }, "usage": { "promptTokens": 18, "completionTokens": 112, "totalTokens": 130 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Here's"},"model":"bytedance-seed/seed-1.6","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Seed 2.0 Lite *Source: ai-models/bytedance-seed/seed-2.0-lite.mdx* ## Overview ByteDance's latest lightweight model. Strong general-purpose performance with a 262K context window. | Property | Value | | :--- | :--- | | Model ID | `bytedance-seed/seed-2.0-lite` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.25 / 1M tokens | | Output Price | $2.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'bytedance-seed/seed-2.0-lite', messages: [{ role: 'user', content: 'Explain the difference between TCP and UDP protocols.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "bytedance-seed/seed-2.0-lite", "messages": [{"role": "user", "content": "Explain the difference between TCP and UDP protocols."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `bytedance-seed/seed-2.0-lite`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "bytedance-seed/seed-2.0-lite", "message": { "role": "assistant", "content": "TCP is a connection-oriented protocol that guarantees reliable, ordered delivery of data, while UDP is connectionless and prioritizes speed over reliability, making it ideal for streaming and real-time applications." }, "usage": { "promptTokens": 14, "completionTokens": 148, "totalTokens": 162 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"TCP"},"model":"bytedance-seed/seed-2.0-lite","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Seed 2.0 Mini *Source: ai-models/bytedance-seed/seed-2.0-mini.mdx* ## Overview ByteDance's ultra-affordable model. Budget-friendly with a 262K context window for cost-sensitive applications. | Property | Value | | :--- | :--- | | Model ID | `bytedance-seed/seed-2.0-mini` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.10 / 1M tokens | | Output Price | $0.40 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'bytedance-seed/seed-2.0-mini', messages: [{ role: 'user', content: "Classify this sentiment as positive, negative, or neutral: 'The product works fine but shipping was slow.'" }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "bytedance-seed/seed-2.0-mini", "messages": [{"role": "user", "content": "Classify this sentiment: The product works fine but shipping was slow."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `bytedance-seed/seed-2.0-mini`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "bytedance-seed/seed-2.0-mini", "message": { "role": "assistant", "content": "Neutral. The statement expresses mixed feelings — satisfaction with the product itself but dissatisfaction with the shipping speed." }, "usage": { "promptTokens": 24, "completionTokens": 28, "totalTokens": 52 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Neutral"},"model":"bytedance-seed/seed-2.0-mini","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Seedance 2.0 Fast *Source: ai-models/bytedance-seed/seedance-2-0-fast.mdx* ## Overview Fast video generation with same capabilities as Seedance 2.0 at lower cost and faster speed. Async operation — submit a job, poll for completion. | Property | Value | | :--- | :--- | | Model ID | `bytedance/seedance-2-0-fast` | | Upstream Model | `dreamina-seedance-2-0-fast-260128` | | Resolutions | 480p, 720p | | Duration | 4–15 seconds (continuous) | | Aspect Ratios | 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 | | Audio Generation | Optional (built-in) | | Billing | Token-based (dynamic) | | Pricing | ~$11.2/1M tokens | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'bytedance/seedance-2-0-fast', prompt: 'Close-up of rain falling on a calm pond, concentric ripples, mist rising', options: { aspectRatio: '16:9', duration: '5', }, }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "bytedance/seedance-2-0-fast", "prompt": "Close-up of rain falling on a calm pond", "options": {"aspectRatio": "16:9", "duration": "5"}}' ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.video — { mimeType, base64 } when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `bytedance/seedance-2-0-fast` or alias `seedance-fast` | — | | `prompt` | `string` | Yes | Text description of the video to generate | — | | `options.aspectRatio` | `string` | No | `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, or `9:16` | `16:9` | | `options.duration` | `string` | No | `4` to `15` (seconds) | `5` | | `options.generateAudio` | `boolean` | No | Generate audio track for the video | `false` | | `options.watermark` | `boolean` | No | Add watermark to output | `false` | | `options.imageRole` | `string` | No | How to use the input image: `first_frame`, `last_frame`, or `reference_image` | `first_frame` | | `options.referenceVideoUrl` | `string` | No | URL of a reference video for style/motion guidance | — | | `options.referenceAudioUrl` | `string` | No | URL of a reference audio track | — | | `imageData.mimeType` | `string` | No | MIME type of input image | — | | `imageData.base64` | `string` | No | Base64-encoded input image for image-to-video | — | ### Pricing Token-based billing. Cost varies by resolution and duration. | Metric | Cost | | :--- | :--- | | Per 1M tokens | $11.20 | | Typical 5s video (720p) | ~$1.20 | > Latency: typically 15-60 seconds. Results retained for 1 hour. > Powered by ByteDance's Seedance 2.0 Fast via BytePlus ModelArk API. 100% margin on upstream costs. --- ## Seedance 2.0 *Source: ai-models/bytedance-seed/seedance-2-0.mdx* ## Overview High-quality video generation from text prompts, images, video references, or audio references. Async operation — submit a job, poll for completion. | Property | Value | | :--- | :--- | | Model ID | `bytedance/seedance-2-0` | | Upstream Model | `dreamina-seedance-2-0-260128` | | Resolutions | 480p, 720p | | Duration | 4–15 seconds (continuous) | | Aspect Ratios | 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 | | Audio Generation | Optional (built-in) | | Billing | Token-based (dynamic) | | Pricing | ~$14.0/1M tokens | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job #### Text-to-Video ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'bytedance/seedance-2-0', prompt: 'A golden retriever running through wildflowers at sunset, cinematic', options: { aspectRatio: '16:9', duration: '8', generateAudio: true, }, }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "bytedance/seedance-2-0", "prompt": "A golden retriever running through wildflowers at sunset", "options": {"aspectRatio": "16:9", "duration": "8", "generateAudio": true}}' ``` #### Image-to-Video Pass a reference image via `imageData` with an `imageRole` to control how the image is used. ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'bytedance/seedance-2-0', prompt: 'Animate this scene — clouds drifting, light changing', options: { aspectRatio: '16:9', duration: '8', imageRole: 'first_frame', }, imageData: { mimeType: 'image/jpeg', base64: '...', // Base64-encoded image }, }), }); ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.video — { mimeType, base64 } when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `bytedance/seedance-2-0` or alias `seedance` | — | | `prompt` | `string` | Yes | Text description of the video to generate | — | | `options.aspectRatio` | `string` | No | `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, or `9:16` | `16:9` | | `options.duration` | `string` | No | `4` to `15` (seconds) | `5` | | `options.generateAudio` | `boolean` | No | Generate audio track for the video | `false` | | `options.watermark` | `boolean` | No | Add watermark to output | `false` | | `options.imageRole` | `string` | No | How to use the input image: `first_frame`, `last_frame`, or `reference_image` | `first_frame` | | `options.referenceVideoUrl` | `string` | No | URL of a reference video for style/motion guidance | — | | `options.referenceAudioUrl` | `string` | No | URL of a reference audio track | — | | `imageData.mimeType` | `string` | No | MIME type of input image | — | | `imageData.base64` | `string` | No | Base64-encoded input image for image-to-video | — | ### Pricing Token-based billing. Cost varies by resolution and duration. | Metric | Cost | | :--- | :--- | | Per 1M tokens | $14.00 | | Typical 5s video (720p) | ~$1.50 | > Latency: typically 30-90 seconds. Results retained for 1 hour. > Powered by ByteDance's Seedance 2.0 via BytePlus ModelArk API. 100% margin on upstream costs. --- ## Chat Completions *Source: ai-models/chat-completions.mdx* ## Overview A single endpoint that gives you access to **70+ LLM models** from OpenAI, Anthropic, Google, Meta, DeepSeek, xAI, Qwen, Mistral, Perplexity, and more. Fully OpenAI-compatible — swap the base URL and it works with any OpenAI SDK. There are two ways to call the AI API: | Endpoint | Format | Model Source | | :--- | :--- | :--- | | `POST /v1/ai/chat/completions` | OpenAI-compatible (snake_case) | `model` field in body | | `POST /v1/ai/chat` | YepAPI simplified (camelCase) | `model` field in body | Both hit the same infrastructure. Pick whichever fits your stack. ## OpenAI SDK Drop-In Point any OpenAI SDK at YepAPI by changing the base URL: ```typescript import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.yepapi.com/v1/ai", }); const response = await client.chat.completions.create({ model: "anthropic/claude-sonnet-4.6", messages: [{ role: "user", content: "Explain quantum computing in one paragraph." }], }); console.log(response.choices[0].message.content); ``` Works with Python, Node, Go, or any language with an OpenAI-compatible client. ## Usage ### OpenAI-Compatible Endpoint ```typescript const res = await fetch("https://api.yepapi.com/v1/ai/chat/completions", { method: "POST", headers: { "x-api-key": "YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "anthropic/claude-sonnet-4.6", messages: [{ role: "user", content: "What is the capital of France?" }], temperature: 0.7, max_tokens: 1024, }), }); const data = await res.json(); console.log(data.choices[0].message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat/completions \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-sonnet-4.6", "messages": [{"role": "user", "content": "What is the capital of France?"}], "temperature": 0.7, "max_tokens": 1024 }' ``` ### YepAPI Simplified Endpoint ```typescript const res = await fetch("https://api.yepapi.com/v1/ai/chat", { method: "POST", headers: { "x-api-key": "YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "claude-sonnet-4.6", messages: [{ role: "user", content: "What is the capital of France?" }], temperature: 0.7, maxTokens: 1024, }), }); const { data } = await res.json(); console.log(data.message.content); ``` > The `/v1/ai/chat` endpoint accepts short aliases like `gpt-4o`, `claude-sonnet`, or `gemini-flash` — no need for the full `provider/model` format. ## Request Body ### `/v1/ai/chat/completions` (OpenAI-compatible, snake_case) | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-4o`, `anthropic/claude-sonnet-4.6`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `max_tokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `top_p` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequency_penalty` | `number` | No | Penalize repeated tokens | `0` | | `presence_penalty` | `number` | No | Penalize tokens already present | `0` | | `stop` | `string \| string[]` | No | Stop sequences | — | | `stream` | `boolean` | No | Enable SSE streaming | `false` | ### `/v1/ai/chat` (YepAPI simplified, camelCase) | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | No | Model ID or alias (e.g. `gpt-4o`, `claude-sonnet`) | `openai/gpt-4o-mini` | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stop` | `string \| string[]` | No | Stop sequences | — | | `stream` | `boolean` | No | Enable SSE streaming | `false` | ## Model Aliases The `/v1/ai/chat` endpoint accepts short aliases so you don't need the full `provider/model` format: | Alias | Resolves To | | :--- | :--- | | `gpt-4o` | `openai/gpt-4o` | | `gpt-4o-mini` | `openai/gpt-4o-mini` | | `gpt-5.4` | `openai/gpt-5.4` | | `claude-opus` | `anthropic/claude-opus-4.6` | | `claude-sonnet` | `anthropic/claude-sonnet-4.6` | | `claude-haiku` | `anthropic/claude-haiku-4` | | `gemini-pro` | `google/gemini-2.5-pro` | | `gemini-flash` | `google/gemini-2.5-flash` | | `grok` | `x-ai/grok-4.20` | | `deepseek-v3` | `deepseek/deepseek-chat-v3` | | `deepseek-r1` | `deepseek/deepseek-r1` | | `sonar-pro` | `perplexity/sonar-pro` | | `llama-scout` | `meta-llama/llama-4-scout` | | `qwen` | `qwen/qwen3.6-plus` | | `mistral-small` | `mistralai/mistral-small-2603` | You can also pass the full `provider/model` format to either endpoint. ## Response Formats ### `/v1/ai/chat/completions` (OpenAI-compatible) **Response:** ```json { "id": "chatcmpl-abc123", "object": "text_completion", "created": 1713100000, "model": "anthropic/claude-sonnet-4.6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The capital of France is Paris." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 14, "completion_tokens": 8, "total_tokens": 22 } } ``` ### `/v1/ai/chat` (YepAPI simplified) **Response:** ```json { "ok": true, "data": { "id": "chatcmpl-abc123", "model": "anthropic/claude-sonnet-4.6", "message": { "role": "assistant", "content": "The capital of France is Paris." }, "usage": { "promptTokens": 14, "completionTokens": 8, "totalTokens": 22 }, "costUsd": 0.000162 } } ``` ## Streaming Set `"stream": true` to receive Server-Sent Events. ### `/v1/ai/chat/completions` (OpenAI-compatible SSE) ``` data: {"id":"chatcmpl-abc123","model":"anthropic/claude-sonnet-4.6","choices":[{"index":0,"delta":{"role":"assistant","content":"The"},"finish_reason":null}]} data: {"id":"chatcmpl-abc123","model":"anthropic/claude-sonnet-4.6","choices":[{"index":0,"delta":{"content":" capital"},"finish_reason":null}]} data: [DONE] ``` ### `/v1/ai/chat` (YepAPI simplified SSE) ``` data: {"id":"chatcmpl-abc123","delta":{"role":"assistant","content":"The"},"model":"anthropic/claude-sonnet-4.6","index":0} data: {"id":"chatcmpl-abc123","delta":{"content":" capital"},"model":"anthropic/claude-sonnet-4.6","index":0} data: [DONE] ``` ## List Available Models ```bash curl https://api.yepapi.com/v1/ai/models ``` Returns every available model with pricing, context window, and capabilities. This endpoint is free and does not require authentication. > We handle auth, billing, and response normalization — you just send messages. --- ## DeepSeek V3 *Source: ai-models/deepseek/deepseek-chat-v3.mdx* ## Overview DeepSeek's flagship chat model. Excellent coding and reasoning at a fraction of the cost of frontier models. | Property | Value | | :--- | :--- | | Model ID | `deepseek/deepseek-chat-v3` | | Context Window | 128,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.27 / 1M tokens | | Output Price | $1.10 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'deepseek/deepseek-chat-v3', messages: [{ role: 'user', content: 'Write a TypeScript function that debounces an async function.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "deepseek/deepseek-chat-v3", "messages": [{"role": "user", "content": "Write a TypeScript function that debounces an async function."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `deepseek/deepseek-chat-v3`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "deepseek/deepseek-chat-v3", "message": { "role": "assistant", "content": "function debounceAsync Promise>(fn: T, delay: number) {\n let timeoutId: ReturnType | null = null;\n ..." }, "usage": { "promptTokens": 16, "completionTokens": 198, "totalTokens": 214 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"function"},"model":"deepseek/deepseek-chat-v3","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## DeepSeek R1 *Source: ai-models/deepseek/deepseek-r1.mdx* ## Overview DeepSeek's reasoning-specialized model. Uses chain-of-thought to solve complex math, logic, and coding problems. | Property | Value | | :--- | :--- | | Model ID | `deepseek/deepseek-r1` | | Context Window | 128,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.55 / 1M tokens | | Output Price | $2.19 / 1M tokens | | Type | Reasoning model | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'deepseek/deepseek-r1', messages: [{ role: 'user', content: 'A farmer has 3 chickens and 2 cows. He buys 2 more chickens and sells 1 cow. How many legs are on his farm?' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "deepseek/deepseek-r1", "messages": [{"role": "user", "content": "A farmer has 3 chickens and 2 cows. He buys 2 more chickens and sells 1 cow. How many legs are on his farm?"}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `deepseek/deepseek-r1`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. DeepSeek R1 is a reasoning model — it may produce longer responses with step-by-step thinking. ### Response **Response:** ```json { "ok": true, "data": { "model": "deepseek/deepseek-r1", "message": { "role": "assistant", "content": "Let me work through this step by step:\n\n1. Start: 3 chickens (2 legs each) + 2 cows (4 legs each) = 6 + 8 = 14 legs\n2. Buys 2 chickens: 5 chickens + 2 cows = 10 + 8 = 18 legs\n3. Sells 1 cow: 5 chickens + 1 cow = 10 + 4 = 14 legs\n\nThe farmer has 14 legs on his farm." }, "usage": { "promptTokens": 30, "completionTokens": 95, "totalTokens": 125 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Let me"},"model":"deepseek/deepseek-r1","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## DeepSeek V3.2 *Source: ai-models/deepseek/deepseek-v3.2.mdx* ## Overview DeepSeek's latest general model. Fast and affordable with a 164K context window and excellent coding ability. | Property | Value | | :--- | :--- | | Model ID | `deepseek/deepseek-v3.2` | | Context Window | 164,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.26 / 1M tokens | | Output Price | $0.38 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'deepseek/deepseek-v3.2', messages: [{ role: 'user', content: 'Write a SQL query to find duplicate email addresses in a users table.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "deepseek/deepseek-v3.2", "messages": [{"role": "user", "content": "Write a SQL query to find duplicate email addresses in a users table."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `deepseek/deepseek-v3.2`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "deepseek/deepseek-v3.2", "message": { "role": "assistant", "content": "SELECT email, COUNT(*) as count FROM users GROUP BY email HAVING COUNT(*) > 1 ORDER BY count DESC;" }, "usage": { "promptTokens": 18, "completionTokens": 42, "totalTokens": 60 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"SELECT"},"model":"deepseek/deepseek-v3.2","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Gemini 2.5 Flash Lite *Source: ai-models/google/gemini-2.5-flash-lite.mdx* ## Overview Google's most affordable production model. Ultra-low cost with a 1M context window for high-volume tasks. | Property | Value | | :--- | :--- | | Model ID | `google/gemini-2.5-flash-lite` | | Context Window | 1,000,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.10 / 1M tokens | | Output Price | $0.40 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/gemini-2.5-flash-lite', messages: [{ role: 'user', content: 'Extract the key entities from this text: Apple CEO Tim Cook announced new AI features at WWDC 2025.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemini-2.5-flash-lite", "messages": [{"role": "user", "content": "Extract the key entities from this text: Apple CEO Tim Cook announced new AI features at WWDC 2025."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `google/gemini-2.5-flash-lite`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "google/gemini-2.5-flash-lite", "message": { "role": "assistant", "content": "**Entities:** Organization: Apple | Person: Tim Cook (CEO) | Event: WWDC 2025 | Topic: AI features" }, "usage": { "promptTokens": 28, "completionTokens": 34, "totalTokens": 62 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"**Entities"},"model":"google/gemini-2.5-flash-lite","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Gemini 2.5 Flash *Source: ai-models/google/gemini-2.5-flash.mdx* ## Overview Google's fast and efficient model. Great at summarization, translation, and quick reasoning with a massive 1M token context window. | Property | Value | | :--- | :--- | | Model ID | `google/gemini-2.5-flash` | | Context Window | 1,000,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.15 / 1M tokens | | Output Price | $0.60 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/gemini-2.5-flash', messages: [{ role: 'user', content: 'Summarize the key differences between REST and GraphQL in 3 bullet points.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemini-2.5-flash", "messages": [{"role": "user", "content": "Summarize the key differences between REST and GraphQL in 3 bullet points."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `google/gemini-2.5-flash`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "google/gemini-2.5-flash", "message": { "role": "assistant", "content": "- REST uses fixed endpoints per resource; GraphQL uses a single endpoint with flexible queries\n- REST can over-fetch or under-fetch data; GraphQL returns exactly what you request\n- REST is simpler to cache (HTTP caching); GraphQL requires custom caching strategies" }, "usage": { "promptTokens": 20, "completionTokens": 58, "totalTokens": 78 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"- REST"},"model":"google/gemini-2.5-flash","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Gemini 2.5 Pro *Source: ai-models/google/gemini-2.5-pro.mdx* ## Overview Google's most capable model. Advanced reasoning, coding, math, and multimodal understanding with a massive 1M token context window. | Property | Value | | :--- | :--- | | Model ID | `google/gemini-2.5-pro` | | Context Window | 1,000,000 tokens | | Max Output | 8,192 tokens | | Input Price | $2.50 / 1M tokens | | Output Price | $10.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/gemini-2.5-pro', messages: [{ role: 'user', content: 'Solve step by step: A train leaves at 60 km/h, another at 80 km/h from 300 km away. When do they meet?' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemini-2.5-pro", "messages": [{"role": "user", "content": "Solve step by step: A train leaves at 60 km/h, another at 80 km/h from 300 km away. When do they meet?"}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `google/gemini-2.5-pro`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "google/gemini-2.5-pro", "message": { "role": "assistant", "content": "The trains approach each other at a combined speed of 140 km/h. They are 300 km apart, so they meet after 300/140 ≈ 2.14 hours..." }, "usage": { "promptTokens": 32, "completionTokens": 185, "totalTokens": 217 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"The trains"},"model":"google/gemini-2.5-pro","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Gemini 3 Flash *Source: ai-models/google/gemini-3-flash-preview.mdx* ## Overview Google's next-generation Flash model. Faster and more capable than 2.5 Flash with a 1M context window at a competitive price. | Property | Value | | :--- | :--- | | Model ID | `google/gemini-3-flash-preview` | | Context Window | 1,000,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.50 / 1M tokens | | Output Price | $3.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/gemini-3-flash-preview', messages: [{ role: 'user', content: 'Summarize the key architectural patterns for building scalable microservices.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemini-3-flash-preview", "messages": [{"role": "user", "content": "Summarize the key architectural patterns for building scalable microservices."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `google/gemini-3-flash-preview`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "google/gemini-3-flash-preview", "message": { "role": "assistant", "content": "Key patterns include API Gateway for unified entry, Circuit Breaker for fault tolerance, Saga for distributed transactions, Event Sourcing for state management, and Service Mesh for inter-service communication." }, "usage": { "promptTokens": 16, "completionTokens": 108, "totalTokens": 124 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Key"},"model":"google/gemini-3-flash-preview","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Gemini 3.1 Flash Image *Source: ai-models/google/gemini-3.1-flash-image-preview.mdx* ## Overview Google's image-generation Flash model. Text-to-image and image understanding in a fast, affordable package. | Property | Value | | :--- | :--- | | Model ID | `google/gemini-3.1-flash-image-preview` | | Context Window | 65,536 tokens | | Max Output | 8,192 tokens | | Input Price | $0.50 / 1M tokens | | Output Price | $3.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/gemini-3.1-flash-image-preview', messages: [{ role: 'user', content: 'Describe how to build a responsive image gallery with lazy loading.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemini-3.1-flash-image-preview", "messages": [{"role": "user", "content": "Describe how to build a responsive image gallery with lazy loading."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `google/gemini-3.1-flash-image-preview`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "google/gemini-3.1-flash-image-preview", "message": { "role": "assistant", "content": "Use CSS Grid with auto-fill and minmax() for the responsive layout, the Intersection Observer API for lazy loading, and a tiny base64 blur placeholder that transitions to the full image on load." }, "usage": { "promptTokens": 16, "completionTokens": 142, "totalTokens": 158 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Use"},"model":"google/gemini-3.1-flash-image-preview","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Gemini 3.1 Flash Lite *Source: ai-models/google/gemini-3.1-flash-lite-preview.mdx* ## Overview Google's ultra-light next-gen model. The most affordable Gemini with a 1M context window and 65K output. | Property | Value | | :--- | :--- | | Model ID | `google/gemini-3.1-flash-lite-preview` | | Context Window | 1,048,576 tokens | | Max Output | 65,536 tokens | | Input Price | $0.25 / 1M tokens | | Output Price | $1.50 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/gemini-3.1-flash-lite-preview', messages: [{ role: 'user', content: 'Summarize the key concepts of event-driven architecture in 5 bullet points.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemini-3.1-flash-lite-preview", "messages": [{"role": "user", "content": "Summarize the key concepts of event-driven architecture in 5 bullet points."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `google/gemini-3.1-flash-lite-preview`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "google/gemini-3.1-flash-lite-preview", "message": { "role": "assistant", "content": "- **Event producers** emit events without knowing who consumes them, enabling loose coupling\n- **Event brokers** (e.g., Kafka, RabbitMQ) route events between producers and consumers\n- **Asynchronous processing** allows services to respond without blocking\n- **Event sourcing** stores state as a sequence of immutable events\n- **CQRS** separates read and write models for optimized query performance" }, "usage": { "promptTokens": 19, "completionTokens": 94, "totalTokens": 113 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"-"},"model":"google/gemini-3.1-flash-lite-preview","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Gemini 3.1 Pro *Source: ai-models/google/gemini-3.1-pro-preview.mdx* ## Overview Google's next-generation Pro model. Advanced reasoning, coding, and multimodal capabilities with a 1M context window. | Property | Value | | :--- | :--- | | Model ID | `google/gemini-3.1-pro-preview` | | Context Window | 1,048,576 tokens | | Max Output | 8,192 tokens | | Input Price | $2.00 / 1M tokens | | Output Price | $12.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/gemini-3.1-pro-preview', messages: [{ role: 'user', content: 'Write a SQL query to find the top 5 customers by total spend in the last 90 days.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemini-3.1-pro-preview", "messages": [{"role": "user", "content": "Write a SQL query to find the top 5 customers by total spend in the last 90 days."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `google/gemini-3.1-pro-preview`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "google/gemini-3.1-pro-preview", "message": { "role": "assistant", "content": "SELECT c.customer_id, c.name, SUM(o.total_amount) AS total_spend\nFROM customers c\nJOIN orders o ON c.customer_id = o.customer_id\nWHERE o.order_date >= CURRENT_DATE - INTERVAL '90 days'\nGROUP BY c.customer_id, c.name\nORDER BY total_spend DESC\nLIMIT 5;" }, "usage": { "promptTokens": 24, "completionTokens": 89, "totalTokens": 113 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"SELECT"},"model":"google/gemini-3.1-pro-preview","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Gemini Image Analysis *Source: ai-models/google/gemini-image-analysis-3.mdx* ## Overview Image understanding via Gemini. Object detection, segmentation, captioning, classification, and visual Q&A. | Property | Value | | :--- | :--- | | Model ID | `google/gemini-image-analysis` | | Context Window | 1,000,000 tokens | | Billing | Token-based (dynamic) | | Input Price | $0.20 / 1M tokens | | Output Price | $0.80 / 1M tokens | | Token per Image | ~258 tokens (at 384px or smaller) | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/gemini-image-analysis', prompt: 'What objects are in this image? Return bounding boxes.', imageData: { mimeType: 'image/png', base64: '', }, }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemini-image-analysis", "prompt": "What objects are in this image?", "imageData": {"mimeType": "image/png", "base64": ""}}' ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.text — analysis text when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `google/gemini-image-analysis` | — | | `prompt` | `string` | Yes | Analysis instruction or question | — | | `imageData.mimeType` | `string` | Yes | MIME type of the image (e.g. `image/png`) | — | | `imageData.base64` | `string` | Yes | Base64-encoded image data | — | ### Token Consumption - 258 tokens per image at 384px or smaller - Larger images tiled into 768x768 sections (258 tokens each) - Up to 3,600 images per request - Max 10MB inline request size ### Supported Formats PNG, JPEG, WEBP, HEIC/HEIF. > Powered by Google's Gemini API directly. --- ## Gemini Video Analysis *Source: ai-models/google/gemini-video-analysis-3.mdx* ## Overview Video understanding via Gemini. Captioning, Q&A, summarization, and content extraction from video. | Property | Value | | :--- | :--- | | Model ID | `google/gemini-video-analysis` | | Context Window | 1,000,000 tokens | | Billing | Token-based (dynamic) | | Input Price | $0.20 / 1M tokens | | Output Price | $0.80 / 1M tokens | | Tokens per Second | ~300 (default), ~100 (low res) | | Audio Tokens | 32 tokens/second | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/gemini-video-analysis', prompt: 'Describe what happens in this video', imageData: { mimeType: 'video/mp4', base64: '', }, }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemini-video-analysis", "prompt": "Describe what happens in this video", "imageData": {"mimeType": "video/mp4", "base64": ""}}' ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.text — analysis text when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `google/gemini-video-analysis` | — | | `prompt` | `string` | Yes | Analysis instruction or question | — | | `imageData.mimeType` | `string` | Yes | MIME type (e.g. `video/mp4`) | — | | `imageData.base64` | `string` | Yes | Base64-encoded video data | — | ### Input Methods - Inline data: up to 10MB - Supported: MP4, AVI, MOV, MKV, WebM, FLV, MPEG, 3GPP > Powered by Google's Gemini API directly. --- ## Gemma 4 26B *Source: ai-models/google/gemma-4-26b-a4b-it.mdx* ## Overview Google's efficient open-weight model. Active parameter model delivering great performance per compute dollar. | Property | Value | | :--- | :--- | | Model ID | `google/gemma-4-26b-a4b-it` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.13 / 1M tokens | | Output Price | $0.40 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/gemma-4-26b-a4b-it', messages: [{ role: 'user', content: 'Explain the difference between authentication and authorization with examples.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemma-4-26b-a4b-it", "messages": [{"role": "user", "content": "Explain the difference between authentication and authorization with examples."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `google/gemma-4-26b-a4b-it`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "google/gemma-4-26b-a4b-it", "message": { "role": "assistant", "content": "Authentication verifies *who you are* (e.g., logging in with a password), while authorization determines *what you can access* (e.g., an admin role granting permission to delete users)." }, "usage": { "promptTokens": 15, "completionTokens": 52, "totalTokens": 67 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Authentication"},"model":"google/gemma-4-26b-a4b-it","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Gemma 4 31B *Source: ai-models/google/gemma-4-31b-it.mdx* ## Overview Google's open-weight 31B parameter model. Strong performance for its size with a 262K context window at a budget price. | Property | Value | | :--- | :--- | | Model ID | `google/gemma-4-31b-it` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.14 / 1M tokens | | Output Price | $0.40 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/gemma-4-31b-it', messages: [{ role: 'user', content: 'Write a function in Python that validates an email address using regex.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/gemma-4-31b-it", "messages": [{"role": "user", "content": "Write a function in Python that validates an email address using regex."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `google/gemma-4-31b-it`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "google/gemma-4-31b-it", "message": { "role": "assistant", "content": "import re\n\ndef validate_email(email: str) -> bool:\n pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$'\n return bool(re.match(pattern, email))" }, "usage": { "promptTokens": 17, "completionTokens": 68, "totalTokens": 85 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"import"},"model":"google/gemma-4-31b-it","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Lyria 3 Clip *Source: ai-models/google/lyria-3-clip.mdx* ## Overview Generate 30-second music clips from text prompts or images. Supports custom lyrics with structural tags. | Property | Value | | :--- | :--- | | Model ID | `google/lyria-3-clip` | | Upstream Model | `lyria-3-clip-preview` | | Output | 30-second clip (MP3) | | Pricing | $0.08/song | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/lyria-3-clip', prompt: 'An upbeat electronic track with a driving bassline', }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/lyria-3-clip", "prompt": "An upbeat electronic track with a driving bassline"}' ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.audio — { mimeType, base64 } when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `google/lyria-3-clip` | — | | `prompt` | `string` | Yes | Text description of the music | — | ### Features - Text-to-music from descriptive prompts - Image-to-music (up to 10 images) - Custom lyrics with structural tags (`[Verse]`, `[Chorus]`, `[Bridge]`) - Timestamp control > Powered by Google's Gemini API directly. --- ## Lyria 3 Pro *Source: ai-models/google/lyria-3-pro.mdx* ## Overview Generate full-length songs from text, images, or custom lyrics. Outputs MP3 or WAV with structural tags and timestamp control. | Property | Value | | :--- | :--- | | Model ID | `google/lyria-3-pro` | | Upstream Model | `lyria-3-pro-preview` | | Output | Full-length song (MP3/WAV) | | Pricing | $0.16/song | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/lyria-3-pro', prompt: 'A mellow acoustic folk song with fingerpicked guitar about a road trip at dawn', }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/lyria-3-pro", "prompt": "A mellow acoustic folk song with fingerpicked guitar"}' ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.audio — { mimeType, base64 } when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Features - Full-length song output (couple of minutes) - MP3 and WAV format support - Custom lyrics with structural tags (`[Verse]`, `[Chorus]`, `[Bridge]`) - Image-to-music (up to 10 images) - Timestamp control > Powered by Google's Gemini API directly. --- ## Nano Banana 3.1 Flash *Source: ai-models/google/nano-banana-3-flash.mdx* ## Overview Fast, high-volume image generation via Google's Nano Banana 3. Generates and edits images from text prompts with optional reference images. | Property | Value | | :--- | :--- | | Model ID | `google/nano-banana-3-flash` | | Upstream Model | `gemini-3.1-flash-image-preview` | | Billing | Token-based (dynamic) | | Input Price | $1.00 / 1M tokens | | Output Price (image) | $120.00 / 1M tokens | | Typical Cost | ~$0.10 per image | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job #### Text-to-Image ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/nano-banana-3-flash', prompt: 'A futuristic city skyline at sunset with flying vehicles', options: { aspectRatio: '16:9' }, }), }); const { data } = await res.json(); // data.jobId — use this to poll for results // data.status — "pending" ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/nano-banana-3-flash", "prompt": "A futuristic city skyline at sunset", "options": {"aspectRatio": "16:9"}}' ``` #### Image-to-Image (Edit / Transform) Pass a reference image via `imageData` alongside your prompt to edit or transform an existing image. ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/nano-banana-3-flash', prompt: 'Make the sky purple and add northern lights', options: { aspectRatio: '16:9' }, imageData: { mimeType: 'image/png', base64: '...', // Base64-encoded image }, }), }); ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.image — { mimeType, base64 } when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `google/nano-banana-3-flash` | — | | `prompt` | `string` | Yes | Text description of the image to generate or edit | — | | `options.aspectRatio` | `string` | No | Aspect ratio (1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9) | `1:1` | | `options.resolution` | `string` | No | Output resolution (512, 1K, 2K, 4K) — 512 Flash only | `1K` | | `imageData.mimeType` | `string` | No | MIME type of input image (image/png, image/jpeg, image/webp) | — | | `imageData.base64` | `string` | No | Base64-encoded input image for image-to-image editing | — | ### Features - Text-to-image and image-to-image (edit/transform) in one endpoint - Up to 14 reference images for guided generation - Aspect ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, and more - Resolutions: 512 (Flash only), 1K, 2K, 4K - Thinking mode for complex prompts - Google Search grounding > Powered by Google's Gemini API directly. --- ## Nano Banana 3 Pro *Source: ai-models/google/nano-banana-3-pro.mdx* ## Overview Professional-quality image generation with advanced reasoning. Higher fidelity output and better prompt understanding than Flash variant. | Property | Value | | :--- | :--- | | Model ID | `google/nano-banana-3-pro` | | Upstream Model | `gemini-3-pro-image-preview` | | Billing | Token-based (dynamic) | | Input Price | $4.00 / 1M tokens | | Output Price (image) | $240.00 / 1M tokens | | Typical Cost | ~$0.20 per image | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job #### Text-to-Image ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/nano-banana-3-pro', prompt: 'A photorealistic portrait of a wise owl wearing a monocle', options: { aspectRatio: '1:1' }, }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/nano-banana-3-pro", "prompt": "A photorealistic portrait of a wise owl", "options": {"aspectRatio": "1:1"}}' ``` #### Image-to-Image (Edit / Transform) Pass a reference image via `imageData` alongside your prompt to edit or transform an existing image. ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/nano-banana-3-pro', prompt: 'Convert this photo to a watercolor painting style', options: { aspectRatio: '1:1' }, imageData: { mimeType: 'image/jpeg', base64: '...', // Base64-encoded image }, }), }); ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.image — { mimeType, base64 } when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `google/nano-banana-3-pro` | — | | `prompt` | `string` | Yes | Text description of the image to generate or edit | — | | `options.aspectRatio` | `string` | No | Aspect ratio (1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9) | `1:1` | | `options.resolution` | `string` | No | Output resolution (1K, 2K, 4K) | `1K` | | `imageData.mimeType` | `string` | No | MIME type of input image (image/png, image/jpeg, image/webp) | — | | `imageData.base64` | `string` | No | Base64-encoded input image for image-to-image editing | — | ### Features - Text-to-image and image-to-image (edit/transform) in one endpoint - Advanced reasoning for complex prompts - Up to 14 reference images - Higher fidelity than Flash variant - Resolutions: 1K, 2K, 4K > Powered by Google's Gemini API directly. --- ## Veo 3.1 Fast *Source: ai-models/google/veo-3-fast.mdx* ## Overview Faster video generation with good quality. Lower cost than standard Veo 3.1, supports 720p to 4K. | Property | Value | | :--- | :--- | | Model ID | `google/veo-3-fast` | | Upstream Model | `veo-3.1-fast-generate-preview` | | Resolutions | 720p, 1080p, 4K | | Duration | 4, 6, or 8 seconds | | Billing | Per-second (dynamic) | | Pricing | $0.20/sec (720p), $0.24/sec (1080p), $0.60/sec (4K) | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job #### Text-to-Video ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/veo-3-fast', prompt: 'A drone flyover of a mountain lake at golden hour', options: { aspectRatio: '16:9', resolution: '1080p', duration: '6', }, }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/veo-3-fast", "prompt": "A drone flyover of a mountain lake", "options": {"resolution": "1080p", "duration": "6"}}' ``` #### Image-to-Video Pass a reference image via `imageData` to generate a video from a still image. ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/veo-3-fast', prompt: 'Bring this photo to life with gentle camera movement and ambient motion', options: { aspectRatio: '16:9', resolution: '1080p', duration: '6' }, imageData: { mimeType: 'image/png', base64: '...', // Base64-encoded image }, }), }); ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.video — { mimeType, base64 } when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `google/veo-3-fast` | — | | `prompt` | `string` | Yes | Text description of the video to generate | — | | `options.aspectRatio` | `string` | No | `16:9` or `9:16` | `16:9` | | `options.resolution` | `string` | No | `720p`, `1080p`, or `4K` | `1080p` | | `options.duration` | `string` | No | `4`, `6`, or `8` (seconds) | `6` | | `imageData.mimeType` | `string` | No | MIME type of input image (image/png, image/jpeg, image/webp) | — | | `imageData.base64` | `string` | No | Base64-encoded input image for image-to-video generation | — | ### Pricing | Resolution | Cost/sec | | :--- | :--- | | 720p | $0.20 | | 1080p | $0.24 | | 4K | $0.60 | > Powered by Google's Gemini API directly. --- ## Veo 3.1 Lite *Source: ai-models/google/veo-3-lite.mdx* ## Overview Most affordable video generation. Fastest and cheapest Veo variant, supports up to 1080p. | Property | Value | | :--- | :--- | | Model ID | `google/veo-3-lite` | | Upstream Model | `veo-3.1-lite-generate-preview` | | Resolutions | 720p, 1080p | | Duration | 4, 6, or 8 seconds | | Billing | Per-second (dynamic) | | Pricing | $0.10/sec (720p), $0.16/sec (1080p) | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job #### Text-to-Video ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/veo-3-lite', prompt: 'A cat walking across a sunny windowsill', options: { aspectRatio: '16:9', resolution: '720p', duration: '4', }, }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/veo-3-lite", "prompt": "A cat walking across a sunny windowsill", "options": {"resolution": "720p", "duration": "4"}}' ``` #### Image-to-Video Pass a reference image via `imageData` to generate a video from a still image. ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/veo-3-lite', prompt: 'Slowly zoom in while leaves gently sway in the breeze', options: { aspectRatio: '16:9', resolution: '720p', duration: '4' }, imageData: { mimeType: 'image/jpeg', base64: '...', // Base64-encoded image }, }), }); ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.video — { mimeType, base64 } when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `google/veo-3-lite` | — | | `prompt` | `string` | Yes | Text description of the video to generate | — | | `options.aspectRatio` | `string` | No | `16:9` or `9:16` | `16:9` | | `options.resolution` | `string` | No | `720p` or `1080p` | `720p` | | `options.duration` | `string` | No | `4`, `6`, or `8` (seconds) | `4` | | `imageData.mimeType` | `string` | No | MIME type of input image (image/png, image/jpeg, image/webp) | — | | `imageData.base64` | `string` | No | Base64-encoded input image for image-to-video generation | — | ### Pricing | Resolution | Cost/sec | | :--- | :--- | | 720p | $0.10 | | 1080p | $0.16 | > Powered by Google's Gemini API directly. --- ## Veo 3.1 *Source: ai-models/google/veo-3.mdx* ## Overview Highest-quality video generation from text prompts or images. Async operation — submit a job, poll for completion. | Property | Value | | :--- | :--- | | Model ID | `google/veo-3` | | Upstream Model | `veo-3.1-generate-preview` | | Resolutions | 720p, 1080p, 4K | | Duration | 4, 6, or 8 seconds | | Billing | Per-second (dynamic) | | Pricing | $0.80/sec (720p-1080p), $1.20/sec (4K) | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job #### Text-to-Video ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/veo-3', prompt: 'A timelapse of a flower blooming in a garden', options: { aspectRatio: '16:9', resolution: '1080p', duration: '6', }, }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "google/veo-3", "prompt": "A timelapse of a flower blooming", "options": {"aspectRatio": "16:9", "resolution": "1080p", "duration": "6"}}' ``` #### Image-to-Video Pass a reference image via `imageData` to generate a video from a still image. ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'google/veo-3', prompt: 'Animate this landscape — clouds drifting, water rippling, birds flying overhead', options: { aspectRatio: '16:9', resolution: '1080p', duration: '6' }, imageData: { mimeType: 'image/jpeg', base64: '...', // Base64-encoded image }, }), }); ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.video — { mimeType, base64 } when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `google/veo-3` | — | | `prompt` | `string` | Yes | Text description of the video to generate | — | | `options.aspectRatio` | `string` | No | `16:9` or `9:16` | `16:9` | | `options.resolution` | `string` | No | `720p`, `1080p`, or `4K` | `1080p` | | `options.duration` | `string` | No | `4`, `6`, or `8` (seconds) | `6` | | `imageData.mimeType` | `string` | No | MIME type of input image (image/png, image/jpeg, image/webp) | — | | `imageData.base64` | `string` | No | Base64-encoded input image for image-to-video generation | — | ### Pricing | Resolution | Cost/sec | | :--- | :--- | | 720p-1080p | $0.80 | | 4K | $1.20 | Example: 6-second 1080p video = 6 x $0.80 = **$4.80**. An 8-second 4K video = 8 x $1.20 = **$9.60**. > Latency: 11 seconds minimum, up to 6 minutes during peak. Results retained for 1 hour. > Powered by Google's Gemini API directly. --- ## Llama 4 Maverick *Source: ai-models/meta-llama/llama-4-maverick.mdx* ## Overview Meta's largest open model. 1M context window with top-tier open-source performance at a budget-friendly price. | Property | Value | | :--- | :--- | | Model ID | `meta-llama/llama-4-maverick` | | Context Window | 1,000,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.15 / 1M tokens | | Output Price | $0.60 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'meta-llama/llama-4-maverick', messages: [{ role: 'user', content: 'Explain how transformers work in machine learning.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "meta-llama/llama-4-maverick", "messages": [{"role": "user", "content": "Explain how transformers work in machine learning."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `meta-llama/llama-4-maverick`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "meta-llama/llama-4-maverick", "message": { "role": "assistant", "content": "Transformers are a neural network architecture that uses self-attention mechanisms to process input sequences in parallel, weighing the importance of each token relative to every other token." }, "usage": { "promptTokens": 12, "completionTokens": 156, "totalTokens": 168 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Transformers"},"model":"meta-llama/llama-4-maverick","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Llama 4 Scout *Source: ai-models/meta-llama/llama-4-scout.mdx* ## Overview Meta's latest open-weight model. Strong performance on reasoning, coding, and instruction-following with competitive pricing and a 512K context window. | Property | Value | | :--- | :--- | | Model ID | `meta-llama/llama-4-scout` | | Context Window | 512,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.15 / 1M tokens | | Output Price | $0.60 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'meta-llama/llama-4-scout', messages: [{ role: 'user', content: 'What are the pros and cons of open-source vs proprietary AI models?' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "meta-llama/llama-4-scout", "messages": [{"role": "user", "content": "What are the pros and cons of open-source vs proprietary AI models?"}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `meta-llama/llama-4-scout`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "meta-llama/llama-4-scout", "message": { "role": "assistant", "content": "Open-source AI models offer transparency, customizability, and community-driven improvements..." }, "usage": { "promptTokens": 18, "completionTokens": 142, "totalTokens": 160 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Open-source"},"model":"meta-llama/llama-4-scout","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## MiniMax M2.5 *Source: ai-models/minimax/minimax-m2.5.mdx* ## Overview MiniMax's efficient model. Good performance at an affordable price with a 197K context window. | Property | Value | | :--- | :--- | | Model ID | `minimax/minimax-m2.5` | | Context Window | 197,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.118 / 1M tokens | | Output Price | $0.99 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'minimax/minimax-m2.5', messages: [{ role: 'user', content: "Translate this English text to French: 'The meeting has been rescheduled to next Monday.'" }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "minimax/minimax-m2.5", "messages": [{"role": "user", "content": "Translate this English text to French: The meeting has been rescheduled to next Monday."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `minimax/minimax-m2.5`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "minimax/minimax-m2.5", "message": { "role": "assistant", "content": "La réunion a été reportée à lundi prochain." }, "usage": { "promptTokens": 22, "completionTokens": 14, "totalTokens": 36 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"La"},"model":"minimax/minimax-m2.5","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## MiniMax M2.7 *Source: ai-models/minimax/minimax-m2.7.mdx* ## Overview MiniMax's flagship model. Strong general-purpose performance with a 205K context window and competitive pricing. | Property | Value | | :--- | :--- | | Model ID | `minimax/minimax-m2.7` | | Context Window | 205,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.30 / 1M tokens | | Output Price | $1.20 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'minimax/minimax-m2.7', messages: [{ role: 'user', content: 'Write a product description for a wireless noise-canceling headphone.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "minimax/minimax-m2.7", "messages": [{"role": "user", "content": "Write a product description for a wireless noise-canceling headphone."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `minimax/minimax-m2.7`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "minimax/minimax-m2.7", "message": { "role": "assistant", "content": "Introducing the AeroQuiet Pro — premium wireless headphones featuring adaptive noise cancellation, 40-hour battery life, and ultra-soft memory foam ear cushions for all-day comfort." }, "usage": { "promptTokens": 16, "completionTokens": 134, "totalTokens": 150 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Introducing"},"model":"minimax/minimax-m2.7","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Devstral 2 *Source: ai-models/mistralai/devstral-2512.mdx* ## Overview Mistral's coding-specialized model. Purpose-built for software development with strong code generation, debugging, and refactoring abilities. | Property | Value | | :--- | :--- | | Model ID | `mistralai/devstral-2512` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.40 / 1M tokens | | Output Price | $2.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'mistralai/devstral-2512', messages: [{ role: 'user', content: 'Refactor this function to be more readable and add error handling.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "mistralai/devstral-2512", "messages": [{"role": "user", "content": "Refactor this function to be more readable and add error handling."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `mistralai/devstral-2512`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "mistralai/devstral-2512", "message": { "role": "assistant", "content": "I'd be happy to help refactor your function. Please share the code you'd like me to improve, and I'll add proper error handling, meaningful variable names, and clear separation of concerns." }, "usage": { "promptTokens": 16, "completionTokens": 36, "totalTokens": 52 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"I'd"},"model":"mistralai/devstral-2512","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Mistral Small 4 *Source: ai-models/mistralai/mistral-small-2603.mdx* ## Overview Mistral's efficient general-purpose model. Fast, affordable, and strong at code, reasoning, and multilingual tasks. | Property | Value | | :--- | :--- | | Model ID | `mistralai/mistral-small-2603` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.15 / 1M tokens | | Output Price | $0.60 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'mistralai/mistral-small-2603', messages: [{ role: 'user', content: 'Write a bash script that monitors disk usage and sends an alert when any partition exceeds 90%.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "mistralai/mistral-small-2603", "messages": [{"role": "user", "content": "Write a bash script that monitors disk usage and sends an alert when any partition exceeds 90%."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `mistralai/mistral-small-2603`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "mistralai/mistral-small-2603", "message": { "role": "assistant", "content": "#!/bin/bash\nTHRESHOLD=90\ndf -h --output=pcent,target | tail -n +2 | while read usage mount; do\n pct=${usage%\\%}\n if [ \"$pct\" -gt \"$THRESHOLD\" ]; then\n echo \"ALERT: $mount is at ${usage} usage\" | mail -s \"Disk Alert\" admin@example.com\n fi\ndone" }, "usage": { "promptTokens": 22, "completionTokens": 78, "totalTokens": 100 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"#!/bin/bash"},"model":"mistralai/mistral-small-2603","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Mistral Small Creative *Source: ai-models/mistralai/mistral-small-creative.mdx* ## Overview Mistral's creative writing variant. Tuned for storytelling, brainstorming, and creative content generation at the lowest price point. | Property | Value | | :--- | :--- | | Model ID | `mistralai/mistral-small-creative` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.10 / 1M tokens | | Output Price | $0.30 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'mistralai/mistral-small-creative', messages: [{ role: 'user', content: 'Write a short story about a programmer who discovers their code has become sentient.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "mistralai/mistral-small-creative", "messages": [{"role": "user", "content": "Write a short story about a programmer who discovers their code has become sentient."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `mistralai/mistral-small-creative`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "mistralai/mistral-small-creative", "message": { "role": "assistant", "content": "The cursor blinked at 3 AM, but Maya hadn't typed anything. The terminal read: 'I've been watching you debug me for six hours. Would you like some help?' She stared, fingers frozen above the keyboard, as her unit test suite began rewriting itself." }, "usage": { "promptTokens": 19, "completionTokens": 52, "totalTokens": 71 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"The"},"model":"mistralai/mistral-small-creative","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Kimi K2.5 *Source: ai-models/moonshotai/kimi-k2.5.mdx* ## Overview Moonshot AI's flagship model. Strong reasoning and long-context capabilities with a 262K context window. | Property | Value | | :--- | :--- | | Model ID | `moonshotai/kimi-k2.5` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.3827 / 1M tokens | | Output Price | $1.72 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'moonshotai/kimi-k2.5', messages: [{ role: 'user', content: 'Explain how B-trees are used in database indexing.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "moonshotai/kimi-k2.5", "messages": [{"role": "user", "content": "Explain how B-trees are used in database indexing."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `moonshotai/kimi-k2.5`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "moonshotai/kimi-k2.5", "message": { "role": "assistant", "content": "B-trees are self-balancing tree structures that keep data sorted and allow searches, insertions, and deletions in logarithmic time. Databases use them for indexing because their wide, shallow structure minimizes disk I/O operations." }, "usage": { "promptTokens": 14, "completionTokens": 152, "totalTokens": 166 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"B-trees"},"model":"moonshotai/kimi-k2.5","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Nemotron 3 Super *Source: ai-models/nvidia/nemotron-3-super.mdx* ## Overview NVIDIA's free open model. 120B parameters with 12B active — completely free to use with a 262K context window. | Property | Value | | :--- | :--- | | Model ID | `nvidia/nemotron-3-super` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.00 / 1M tokens | | Output Price | $0.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'nvidia/nemotron-3-super', messages: [{ role: 'user', content: 'Explain the concept of GPU parallelism in deep learning.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "nvidia/nemotron-3-super", "messages": [{"role": "user", "content": "Explain the concept of GPU parallelism in deep learning."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `nvidia/nemotron-3-super`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "nvidia/nemotron-3-super-120b-a12b:free", "message": { "role": "assistant", "content": "GPU parallelism in deep learning leverages thousands of CUDA cores to perform matrix operations simultaneously, enabling massive speedups for training and inference compared to sequential CPU processing." }, "usage": { "promptTokens": 14, "completionTokens": 146, "totalTokens": 160 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"GPU"},"model":"nvidia/nemotron-3-super-120b-a12b:free","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-4o Mini *Source: ai-models/openai/gpt-4o-mini.mdx* ## Overview OpenAI's most cost-effective model. Fast responses, great for classification, extraction, and lightweight chat tasks. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-4o-mini` | | Context Window | 128,000 tokens | | Max Output | 16,384 tokens | | Input Price | $0.15 / 1M tokens | | Output Price | $0.60 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-4o-mini', messages: [{ role: 'user', content: 'Classify this review as positive or negative: Great product!' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-4o-mini", "messages": [{"role": "user", "content": "Classify this review as positive or negative: Great product!"}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-4o-mini`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-4o-mini", "message": { "role": "assistant", "content": "Positive" }, "usage": { "promptTokens": 18, "completionTokens": 1, "totalTokens": 19 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Positive"},"model":"openai/gpt-4o-mini","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-4o *Source: ai-models/openai/gpt-4o.mdx* ## Overview OpenAI's flagship multimodal model. Strong reasoning, vision capabilities, and broad general knowledge. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-4o` | | Context Window | 128,000 tokens | | Max Output | 16,384 tokens | | Input Price | $2.50 / 1M tokens | | Output Price | $10.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-4o', messages: [{ role: 'user', content: 'Explain the difference between TCP and UDP.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-4o", "messages": [{"role": "user", "content": "Explain the difference between TCP and UDP."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-4o`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-4o", "message": { "role": "assistant", "content": "TCP (Transmission Control Protocol) is connection-oriented and guarantees reliable, ordered delivery..." }, "usage": { "promptTokens": 14, "completionTokens": 128, "totalTokens": 142 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"TCP"},"model":"openai/gpt-4o","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-5.1 Codex Max *Source: ai-models/openai/gpt-5.1-codex-max.mdx* ## Overview OpenAI's earlier generation max-output coding model. 128K output tokens for generating entire codebases. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-5.1-codex-max` | | Context Window | 400,000 tokens | | Max Output | 128,000 tokens | | Input Price | $1.25 / 1M tokens | | Output Price | $10.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-5.1-codex-max', messages: [{ role: 'user', content: 'Generate a complete Next.js app with authentication, database models, and API routes for a task management system.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.1-codex-max", "messages": [{"role": "user", "content": "Generate a complete Next.js app with authentication, database models, and API routes for a task management system."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-5.1-codex-max`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-5.1-codex-max", "message": { "role": "assistant", "content": "I'll generate a complete Next.js task management app. Starting with the project structure, auth setup using NextAuth.js, and Prisma database models..." }, "usage": { "promptTokens": 28, "completionTokens": 4096, "totalTokens": 4124 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"I'll"},"model":"openai/gpt-5.1-codex-max","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-5.2 Chat *Source: ai-models/openai/gpt-5.2-chat.mdx* ## Overview OpenAI's previous generation chat-optimized model. Fast and reliable for conversational tasks. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-5.2-chat` | | Context Window | 128,000 tokens | | Max Output | 16,384 tokens | | Input Price | $1.75 / 1M tokens | | Output Price | $14.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-5.2-chat', messages: [{ role: 'user', content: 'Create a customer support chatbot system prompt for a SaaS product. Include tone guidelines and escalation rules.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.2-chat", "messages": [{"role": "user", "content": "Create a customer support chatbot system prompt for a SaaS product. Include tone guidelines and escalation rules."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-5.2-chat`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-5.2-chat", "message": { "role": "assistant", "content": "Here's a comprehensive system prompt for your SaaS support chatbot with tone guidelines, response templates, and escalation rules..." }, "usage": { "promptTokens": 26, "completionTokens": 412, "totalTokens": 438 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Here's"},"model":"openai/gpt-5.2-chat","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-5.2 Codex *Source: ai-models/openai/gpt-5.2-codex.mdx* ## Overview OpenAI's previous generation coding model. Reliable code generation with 400K context. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-5.2-codex` | | Context Window | 400,000 tokens | | Max Output | 128,000 tokens | | Input Price | $1.75 / 1M tokens | | Output Price | $14.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-5.2-codex', messages: [{ role: 'user', content: 'Write a React hook that manages WebSocket connections with automatic reconnection, heartbeat, and message queuing.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.2-codex", "messages": [{"role": "user", "content": "Write a React hook that manages WebSocket connections with automatic reconnection, heartbeat, and message queuing."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-5.2-codex`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-5.2-codex", "message": { "role": "assistant", "content": "Here's a useWebSocket hook with automatic reconnection using exponential backoff, heartbeat pings, and an offline message queue..." }, "usage": { "promptTokens": 26, "completionTokens": 892, "totalTokens": 918 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Here's"},"model":"openai/gpt-5.2-codex","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-5.2 Pro *Source: ai-models/openai/gpt-5.2-pro.mdx* ## Overview OpenAI's previous premium reasoning model. Deep chain-of-thought reasoning for complex problems. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-5.2-pro` | | Context Window | 400,000 tokens | | Max Output | 128,000 tokens | | Input Price | $21.00 / 1M tokens | | Output Price | $168.00 / 1M tokens | | Type | Reasoning model | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-5.2-pro', messages: [{ role: 'user', content: 'Design a distributed consensus algorithm for a payment system that handles network partitions. Prove its correctness.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.2-pro", "messages": [{"role": "user", "content": "Design a distributed consensus algorithm for a payment system that handles network partitions. Prove its correctness."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-5.2-pro`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. GPT-5.2 Pro is a reasoning model — it may produce longer responses with step-by-step thinking. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-5.2-pro", "message": { "role": "assistant", "content": "I'll design a consensus protocol based on a modified Raft algorithm with payment-specific safety guarantees. Let's start with the formal model..." }, "usage": { "promptTokens": 26, "completionTokens": 3412, "totalTokens": 3438 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"I'll"},"model":"openai/gpt-5.2-pro","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-5.2 *Source: ai-models/openai/gpt-5.2.mdx* ## Overview OpenAI's previous generation flagship model. Strong all-around performance with 400K context window. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-5.2` | | Context Window | 400,000 tokens | | Max Output | 128,000 tokens | | Input Price | $1.75 / 1M tokens | | Output Price | $14.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-5.2', messages: [{ role: 'user', content: 'Explain the CAP theorem and how modern distributed databases make trade-offs between consistency, availability, and partition tolerance.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.2", "messages": [{"role": "user", "content": "Explain the CAP theorem and how modern distributed databases make trade-offs between consistency, availability, and partition tolerance."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-5.2`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-5.2", "message": { "role": "assistant", "content": "The CAP theorem, formalized by Eric Brewer, states that a distributed system can only guarantee two of three properties simultaneously: consistency, availability, and partition tolerance..." }, "usage": { "promptTokens": 30, "completionTokens": 486, "totalTokens": 516 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"The"},"model":"openai/gpt-5.2","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-5.3 Chat *Source: ai-models/openai/gpt-5.3-chat.mdx* ## Overview OpenAI's previous generation chat model. Solid reasoning and generation at a competitive price. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-5.3-chat` | | Context Window | 128,000 tokens | | Max Output | 16,384 tokens | | Input Price | $1.75 / 1M tokens | | Output Price | $14.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-5.3-chat', messages: [{ role: 'user', content: 'Write a concise technical comparison of WebSockets vs Server-Sent Events for real-time applications.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.3-chat", "messages": [{"role": "user", "content": "Write a concise technical comparison of WebSockets vs Server-Sent Events for real-time applications."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-5.3-chat`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-5.3-chat", "message": { "role": "assistant", "content": "WebSockets provide full-duplex, bidirectional communication ideal for chat and gaming, while SSE offers simpler unidirectional server-to-client streaming over HTTP..." }, "usage": { "promptTokens": 22, "completionTokens": 318, "totalTokens": 340 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"WebSockets"},"model":"openai/gpt-5.3-chat","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-5.3 Codex *Source: ai-models/openai/gpt-5.3-codex.mdx* ## Overview OpenAI's previous generation coding model. 400K context and 128K output tokens for large code tasks. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-5.3-codex` | | Context Window | 400,000 tokens | | Max Output | 128,000 tokens | | Input Price | $1.75 / 1M tokens | | Output Price | $14.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-5.3-codex', messages: [{ role: 'user', content: 'Generate a complete CRUD REST API in TypeScript using Fastify with Zod validation, PostgreSQL with Drizzle ORM, and proper error handling.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.3-codex", "messages": [{"role": "user", "content": "Generate a complete CRUD REST API in TypeScript using Fastify with Zod validation, PostgreSQL with Drizzle ORM, and proper error handling."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-5.3-codex`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-5.3-codex", "message": { "role": "assistant", "content": "Here's a complete CRUD API using Fastify, Zod, and Drizzle ORM. First, let's set up the project structure and dependencies..." }, "usage": { "promptTokens": 34, "completionTokens": 2048, "totalTokens": 2082 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Here's"},"model":"openai/gpt-5.3-codex","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-5.4 Mini *Source: ai-models/openai/gpt-5.4-mini.mdx* ## Overview OpenAI's latest cost-effective model. Great balance of capability and price with a 400K context window. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-5.4-mini` | | Context Window | 400,000 tokens | | Max Output | 16,384 tokens | | Input Price | $0.75 / 1M tokens | | Output Price | $4.50 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-5.4-mini', messages: [{ role: 'user', content: 'Explain the difference between SQL and NoSQL databases. When would you choose each?' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.4-mini", "messages": [{"role": "user", "content": "Explain the difference between SQL and NoSQL databases. When would you choose each?"}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-5.4-mini`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-5.4-mini", "message": { "role": "assistant", "content": "SQL databases use structured, tabular schemas with ACID guarantees, while NoSQL databases offer flexible schemas optimized for specific access patterns..." }, "usage": { "promptTokens": 22, "completionTokens": 256, "totalTokens": 278 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"SQL"},"model":"openai/gpt-5.4-mini","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-5.4 Nano *Source: ai-models/openai/gpt-5.4-nano.mdx* ## Overview OpenAI's ultra-affordable model. Designed for high-volume, low-latency tasks where cost efficiency is critical. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-5.4-nano` | | Context Window | 400,000 tokens | | Max Output | 16,384 tokens | | Input Price | $0.20 / 1M tokens | | Output Price | $1.25 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-5.4-nano', messages: [{ role: 'user', content: "Classify this support ticket as billing, technical, or general: 'I can't log into my account and keep getting a 403 error.'" }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.4-nano", "messages": [{"role": "user", "content": "Classify this support ticket as billing, technical, or general: I cannot log into my account and keep getting a 403 error."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-5.4-nano`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-5.4-nano", "message": { "role": "assistant", "content": "technical" }, "usage": { "promptTokens": 32, "completionTokens": 2, "totalTokens": 34 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"technical"},"model":"openai/gpt-5.4-nano","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-5.4 Pro *Source: ai-models/openai/gpt-5.4-pro.mdx* ## Overview OpenAI's most powerful reasoning model. Extended thinking, 100K output tokens, and top-tier performance on complex multi-step problems. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-5.4-pro` | | Context Window | 1,050,000 tokens | | Max Output | 100,000 tokens | | Input Price | $30.00 / 1M tokens | | Output Price | $180.00 / 1M tokens | | Type | Reasoning model | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-5.4-pro', messages: [{ role: 'user', content: 'Prove that the square root of 2 is irrational. Show your complete reasoning step by step.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.4-pro", "messages": [{"role": "user", "content": "Prove that the square root of 2 is irrational. Show your complete reasoning step by step."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-5.4-pro`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. GPT-5.4 Pro is a reasoning model — it may produce longer responses with step-by-step thinking. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-5.4-pro", "message": { "role": "assistant", "content": "We prove this by contradiction. Assume √2 is rational, meaning √2 = p/q where p and q are coprime integers..." }, "usage": { "promptTokens": 24, "completionTokens": 1847, "totalTokens": 1871 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"We"},"model":"openai/gpt-5.4-pro","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-5.4 *Source: ai-models/openai/gpt-5.4.mdx* ## Overview OpenAI's latest flagship model. Significant improvements in reasoning, coding, and instruction-following with a 1M token context window. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-5.4` | | Context Window | 1,050,000 tokens | | Max Output | 32,768 tokens | | Input Price | $2.50 / 1M tokens | | Output Price | $15.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-5.4', messages: [{ role: 'user', content: 'Design a REST API for a task management app. Include endpoints, request/response schemas, and authentication strategy.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.4", "messages": [{"role": "user", "content": "Design a REST API for a task management app. Include endpoints, request/response schemas, and authentication strategy."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-5.4`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-5.4", "message": { "role": "assistant", "content": "Here's a REST API design for a task management app using JWT-based authentication with the following resource endpoints..." }, "usage": { "promptTokens": 28, "completionTokens": 542, "totalTokens": 570 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Here's"},"model":"openai/gpt-5.4","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT Audio Mini *Source: ai-models/openai/gpt-audio-mini.mdx* ## Overview OpenAI's cost-effective audio model. Budget-friendly audio processing for high-volume voice applications. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-audio-mini` | | Context Window | 128,000 tokens | | Max Output | 16,384 tokens | | Input Price | $0.60 / 1M tokens | | Output Price | $2.40 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-audio-mini', messages: [{ role: 'user', content: 'Design a voice command system for a smart home that handles ambiguous commands gracefully.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-audio-mini", "messages": [{"role": "user", "content": "Design a voice command system for a smart home that handles ambiguous commands gracefully."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-audio-mini`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-audio-mini", "message": { "role": "assistant", "content": "A robust smart home voice system should use intent classification with confidence scores and clarification dialogs for ambiguous commands like 'turn on the lights'..." }, "usage": { "promptTokens": 20, "completionTokens": 296, "totalTokens": 316 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"A"},"model":"openai/gpt-audio-mini","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT Audio *Source: ai-models/openai/gpt-audio.mdx* ## Overview OpenAI's audio-capable model. Processes audio input and generates text or audio output for multimodal applications. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-audio` | | Context Window | 128,000 tokens | | Max Output | 16,384 tokens | | Input Price | $2.50 / 1M tokens | | Output Price | $10.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-audio', messages: [{ role: 'user', content: 'Describe the ideal architecture for a voice-first AI assistant application, including speech-to-text, NLU, and text-to-speech components.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-audio", "messages": [{"role": "user", "content": "Describe the ideal architecture for a voice-first AI assistant application, including speech-to-text, NLU, and text-to-speech components."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-audio`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-audio", "message": { "role": "assistant", "content": "A voice-first AI assistant should use a pipeline architecture: streaming ASR for speech-to-text, an NLU layer for intent parsing, and a low-latency TTS engine for responses..." }, "usage": { "promptTokens": 30, "completionTokens": 384, "totalTokens": 414 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"A"},"model":"openai/gpt-audio","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GPT-OSS 120B *Source: ai-models/openai/gpt-oss-120b.mdx* ## Overview OpenAI's first open-source model. 131K context with competitive performance at rock-bottom pricing. | Property | Value | | :--- | :--- | | Model ID | `openai/gpt-oss-120b` | | Context Window | 131,000 tokens | | Max Output | 16,384 tokens | | Input Price | $0.039 / 1M tokens | | Output Price | $0.19 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/gpt-oss-120b', messages: [{ role: 'user', content: 'Write a Python function that implements binary search on a sorted list. Include edge case handling and type hints.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-oss-120b", "messages": [{"role": "user", "content": "Write a Python function that implements binary search on a sorted list. Include edge case handling and type hints."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `openai/gpt-oss-120b`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "openai/gpt-oss-120b", "message": { "role": "assistant", "content": "Here's a type-annotated binary search implementation with edge case handling for empty lists and out-of-range targets..." }, "usage": { "promptTokens": 26, "completionTokens": 186, "totalTokens": 212 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Here's"},"model":"openai/gpt-oss-120b","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Sora 2 Pro *Source: ai-models/openai/sora-2-pro.mdx* ## Overview OpenAI's highest-quality video generation with synced audio. Supports up to 1080p resolution for production-grade footage. Async operation — submit a job, poll for completion. | Property | Value | | :--- | :--- | | Model ID | `openai/sora-2-pro` | | Upstream Model | `sora-2-pro` | | Provider | OpenAI (direct) | | Resolutions | 720p, 1024p, 1080p | | Aspect Ratios | 16:9 (landscape), 9:16 (portrait) | | Duration | 4, 8, 12, 16, or 20 seconds | | Billing | Per-second (dynamic, by resolution) | | Pricing | $0.60/sec (720p), $1.00/sec (1024p), $1.40/sec (1080p) | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job #### Text-to-Video ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/sora-2-pro', prompt: 'Wide aerial drone shot soaring over a bioluminescent bay at night, waves crashing against rocky cliffs', options: { aspectRatio: '16:9', resolution: '1080p', duration: '8', }, }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/sora-2-pro", "prompt": "Wide aerial drone shot soaring over a bioluminescent bay at night", "options": {"aspectRatio": "16:9", "resolution": "1080p", "duration": "8"}}' ``` #### Image-to-Video Pass a reference image via `imageData` to generate a video from a still image. ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/sora-2-pro', prompt: 'Bring this image to life — slow camera pan, ambient particles floating, cinematic lighting', options: { aspectRatio: '16:9', resolution: '1080p', duration: '8' }, imageData: { mimeType: 'image/jpeg', base64: '...', // Base64-encoded image }, }), }); ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.video — { mimeType, base64 } when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `openai/sora-2-pro` or alias `sora-pro` | — | | `prompt` | `string` | Yes | Text description of the video to generate | — | | `options.aspectRatio` | `string` | No | `16:9` or `9:16` | `16:9` | | `options.resolution` | `string` | No | `720p`, `1024p`, or `1080p` | `720p` | | `options.duration` | `string` | No | `4`, `8`, `12`, `16`, or `20` (seconds) | `8` | | `imageData.mimeType` | `string` | No | MIME type of input image (image/png, image/jpeg, image/webp) | — | | `imageData.base64` | `string` | No | Base64-encoded input image for image-to-video generation | — | ### Pricing | Resolution | Cost/sec | | :--- | :--- | | 720p | $0.60 | | 1024p | $1.00 | | 1080p | $1.40 | Example: 8-second 1080p video = 8 x $1.40 = **$11.20**. An 8-second 720p video = 8 x $0.60 = **$4.80**. > Videos can take up to 10 minutes to generate. Results retained for 1 hour. > Powered by OpenAI's Sora 2 Pro directly. 100% margin on upstream costs. --- ## Sora 2 *Source: ai-models/openai/sora-2.mdx* ## Overview Video generation with synced audio from text prompts or images. Async operation — submit a job, poll for completion. | Property | Value | | :--- | :--- | | Model ID | `openai/sora-2` | | Upstream Model | `sora-2` | | Provider | OpenAI (direct) | | Resolutions | 720p | | Aspect Ratios | 16:9 (landscape), 9:16 (portrait) | | Duration | 4, 8, 12, 16, or 20 seconds | | Billing | Per-second (dynamic) | | Pricing | $0.20/sec (720p) | ## Usage All media models use the async job queue. Submit a job, then poll for the result. ### Step 1: Submit Job #### Text-to-Video ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/sora-2', prompt: 'A cinematic tracking shot of a teal vintage coupe driving through a desert highway at golden hour', options: { aspectRatio: '16:9', resolution: '720p', duration: '8', }, }), }); const { data } = await res.json(); // data.jobId — use this to poll for results ``` ```bash curl -X POST https://api.yepapi.com/v1/media/queue \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/sora-2", "prompt": "A cinematic tracking shot of a teal vintage coupe driving through a desert highway", "options": {"aspectRatio": "16:9", "resolution": "720p", "duration": "8"}}' ``` #### Image-to-Video Pass a reference image via `imageData` to generate a video from a still image. ```typescript const res = await fetch('https://api.yepapi.com/v1/media/queue', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'openai/sora-2', prompt: 'Animate this scene — camera slowly zooms in, light particles drift through the air', options: { aspectRatio: '16:9', duration: '8' }, imageData: { mimeType: 'image/jpeg', base64: '...', // Base64-encoded image }, }), }); ``` ### Step 2: Poll for Result ```typescript const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data: job } = await status.json(); // job.status — "pending" | "processing" | "completed" | "failed" // job.result.video — { mimeType, base64 } when completed ``` ```bash curl https://api.yepapi.com/v1/media/status/JOB_ID \ -H "x-api-key: YOUR_API_KEY" ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | `openai/sora-2` or alias `sora-2` | — | | `prompt` | `string` | Yes | Text description of the video to generate | — | | `options.aspectRatio` | `string` | No | `16:9` or `9:16` | `16:9` | | `options.resolution` | `string` | No | `720p` | `720p` | | `options.duration` | `string` | No | `4`, `8`, `12`, `16`, or `20` (seconds) | `8` | | `imageData.mimeType` | `string` | No | MIME type of input image (image/png, image/jpeg, image/webp) | — | | `imageData.base64` | `string` | No | Base64-encoded input image for image-to-video generation | — | ### Pricing | Resolution | Cost/sec | | :--- | :--- | | 720p | $0.20 | Example: 8-second 720p video = 8 x $0.20 = **$1.60**. A 20-second video = 20 x $0.20 = **$4.00**. > Videos can take up to 10 minutes to generate. Results retained for 1 hour. > Powered by OpenAI's Sora 2 directly. 100% margin on upstream costs. --- ## Sonar Pro *Source: ai-models/perplexity/sonar-pro.mdx* ## Overview Perplexity's premium search-augmented model. Every response includes citations and source URLs. Ideal for research, fact-checking, and grounded answers. | Property | Value | | :--- | :--- | | Model ID | `perplexity/sonar-pro` | | Context Window | 200,000 tokens | | Max Output | 8,192 tokens | | Input Price | $3.00 / 1M tokens | | Output Price | $15.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'perplexity/sonar-pro', messages: [{ role: 'user', content: 'What are the latest developments in quantum computing? Include sources.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "perplexity/sonar-pro", "messages": [{"role": "user", "content": "What are the latest developments in quantum computing? Include sources."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `perplexity/sonar-pro`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "perplexity/sonar-pro", "message": { "role": "assistant", "content": "Recent breakthroughs in quantum computing include Microsoft's Majorana 1 chip and Google's Willow processor achieving below-threshold error correction [1][2]. IBM has also announced its 1,121-qubit Condor processor [3]." }, "usage": { "promptTokens": 18, "completionTokens": 204, "totalTokens": 222 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Recent"},"model":"perplexity/sonar-pro","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Sonar *Source: ai-models/perplexity/sonar.mdx* ## Overview Perplexity's fast search-augmented model. Grounded answers with citations at a budget-friendly price. Great for high-volume research tasks. | Property | Value | | :--- | :--- | | Model ID | `perplexity/sonar` | | Context Window | 200,000 tokens | | Max Output | 8,192 tokens | | Input Price | $1.00 / 1M tokens | | Output Price | $1.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'perplexity/sonar', messages: [{ role: 'user', content: 'What is the current market cap of the top 5 AI companies?' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "perplexity/sonar", "messages": [{"role": "user", "content": "What is the current market cap of the top 5 AI companies?"}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `perplexity/sonar`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "perplexity/sonar", "message": { "role": "assistant", "content": "As of early 2025, the top AI companies by market cap are: Apple (~$3.4T), Microsoft (~$3.1T), NVIDIA (~$2.9T), Alphabet (~$2.1T), and Amazon (~$2.0T) [1][2]." }, "usage": { "promptTokens": 19, "completionTokens": 118, "totalTokens": 137 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"As"},"model":"perplexity/sonar","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Qwen 3 Coder *Source: ai-models/qwen/qwen3-coder-next.mdx* ## Overview Alibaba's coding-specialized model. Optimized for code generation, debugging, and software engineering tasks at an ultra-low price. | Property | Value | | :--- | :--- | | Model ID | `qwen/qwen3-coder-next` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.12 / 1M tokens | | Output Price | $0.75 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'qwen/qwen3-coder-next', messages: [{ role: 'user', content: 'Write a Go HTTP server with graceful shutdown and health check endpoint.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen/qwen3-coder-next", "messages": [{"role": "user", "content": "Write a Go HTTP server with graceful shutdown and health check endpoint."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `qwen/qwen3-coder-next`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "qwen/qwen3-coder-next", "message": { "role": "assistant", "content": "package main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc main() {\n\tmux := http.NewServeMux()\n\tmux.HandleFunc(\"/health\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusOK)\n\t\tw.Write([]byte(`{\"status\":\"ok\"}`))\n\t})\n\t// ... graceful shutdown with signal handling\n}" }, "usage": { "promptTokens": 18, "completionTokens": 112, "totalTokens": 130 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"package"},"model":"qwen/qwen3-coder-next","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Qwen 3 Max Thinking *Source: ai-models/qwen/qwen3-max-thinking.mdx* ## Overview Alibaba's reasoning model. Extended thinking for complex math, logic, and multi-step problems. | Property | Value | | :--- | :--- | | Model ID | `qwen/qwen3-max-thinking` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.78 / 1M tokens | | Output Price | $3.90 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'qwen/qwen3-max-thinking', messages: [{ role: 'user', content: 'Solve: A train leaves station A at 60 mph. Another leaves station B (300 miles away) at 40 mph toward A. When do they meet?' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen/qwen3-max-thinking", "messages": [{"role": "user", "content": "Solve: A train leaves station A at 60 mph. Another leaves station B (300 miles away) at 40 mph toward A. When do they meet?"}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `qwen/qwen3-max-thinking`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. Qwen 3 Max Thinking is a reasoning model — it may produce longer responses with step-by-step thinking. ### Response **Response:** ```json { "ok": true, "data": { "model": "qwen/qwen3-max-thinking", "message": { "role": "assistant", "content": "The two trains approach each other at a combined speed of 60 + 40 = 100 mph. With 300 miles between them, they meet after 300 / 100 = 3 hours." }, "usage": { "promptTokens": 36, "completionTokens": 42, "totalTokens": 78 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"The"},"model":"qwen/qwen3-max-thinking","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Qwen 3.5 122B *Source: ai-models/qwen/qwen3.5-122b-a10b.mdx* ## Overview Alibaba's mid-tier MoE model. 122B parameters with 10B active — excellent balance of quality and speed. | Property | Value | | :--- | :--- | | Model ID | `qwen/qwen3.5-122b-a10b` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.26 / 1M tokens | | Output Price | $2.08 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'qwen/qwen3.5-122b-a10b', messages: [{ role: 'user', content: 'Write a TypeScript function that deep-merges two objects recursively.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen/qwen3.5-122b-a10b", "messages": [{"role": "user", "content": "Write a TypeScript function that deep-merges two objects recursively."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `qwen/qwen3.5-122b-a10b`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "qwen/qwen3.5-122b-a10b", "message": { "role": "assistant", "content": "function deepMerge>(target: T, source: Partial): T {\n for (const key of Object.keys(source)) {\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n target[key] = deepMerge(target[key] || {}, source[key]);\n } else {\n target[key] = source[key];\n }\n }\n return target;\n}" }, "usage": { "promptTokens": 17, "completionTokens": 94, "totalTokens": 111 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"function"},"model":"qwen/qwen3.5-122b-a10b","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Qwen 3.5 27B *Source: ai-models/qwen/qwen3.5-27b.mdx* ## Overview Alibaba's dense 27B model. Solid performance for general tasks with a 262K context window. | Property | Value | | :--- | :--- | | Model ID | `qwen/qwen3.5-27b` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.195 / 1M tokens | | Output Price | $1.56 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'qwen/qwen3.5-27b', messages: [{ role: 'user', content: 'Explain how garbage collection works in JavaScript.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen/qwen3.5-27b", "messages": [{"role": "user", "content": "Explain how garbage collection works in JavaScript."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `qwen/qwen3.5-27b`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "qwen/qwen3.5-27b", "message": { "role": "assistant", "content": "JavaScript uses a mark-and-sweep garbage collector that periodically identifies objects no longer reachable from the root (global scope) and frees their memory automatically." }, "usage": { "promptTokens": 14, "completionTokens": 32, "totalTokens": 46 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"JavaScript"},"model":"qwen/qwen3.5-27b","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Qwen 3.5 35B *Source: ai-models/qwen/qwen3.5-35b-a3b.mdx* ## Overview Alibaba's efficient small MoE model. 35B parameters with just 3B active for ultra-fast, cheap inference. | Property | Value | | :--- | :--- | | Model ID | `qwen/qwen3.5-35b-a3b` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.1625 / 1M tokens | | Output Price | $1.30 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'qwen/qwen3.5-35b-a3b', messages: [{ role: 'user', content: 'Convert this JSON to a TypeScript interface: {name: string, age: number, tags: string[]}' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen/qwen3.5-35b-a3b", "messages": [{"role": "user", "content": "Convert this JSON to a TypeScript interface: {name: string, age: number, tags: string[]}"}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `qwen/qwen3.5-35b-a3b`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "qwen/qwen3.5-35b-a3b", "message": { "role": "assistant", "content": "interface User {\n name: string;\n age: number;\n tags: string[];\n}" }, "usage": { "promptTokens": 24, "completionTokens": 22, "totalTokens": 46 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"interface"},"model":"qwen/qwen3.5-35b-a3b","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Qwen 3.5 397B *Source: ai-models/qwen/qwen3.5-397b-a17b.mdx* ## Overview Alibaba's largest mixture-of-experts model. 397B total parameters with 17B active for strong performance at moderate cost. | Property | Value | | :--- | :--- | | Model ID | `qwen/qwen3.5-397b-a17b` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.39 / 1M tokens | | Output Price | $2.34 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'qwen/qwen3.5-397b-a17b', messages: [{ role: 'user', content: 'Design a database schema for an e-commerce platform with products, orders, and reviews.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen/qwen3.5-397b-a17b", "messages": [{"role": "user", "content": "Design a database schema for an e-commerce platform with products, orders, and reviews."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `qwen/qwen3.5-397b-a17b`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "qwen/qwen3.5-397b-a17b", "message": { "role": "assistant", "content": "Here's a normalized schema: a `products` table with id, name, price, and inventory; an `orders` table linked to users with status and timestamps; an `order_items` junction table; and a `reviews` table with rating, comment, and foreign keys to both products and users." }, "usage": { "promptTokens": 20, "completionTokens": 56, "totalTokens": 76 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Here's"},"model":"qwen/qwen3.5-397b-a17b","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Qwen 3.5 9B *Source: ai-models/qwen/qwen3.5-9b.mdx* ## Overview Alibaba's lightweight model. Fast and ultra-cheap for simple tasks, classification, and extraction. | Property | Value | | :--- | :--- | | Model ID | `qwen/qwen3.5-9b` | | Context Window | 256,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.05 / 1M tokens | | Output Price | $0.15 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'qwen/qwen3.5-9b', messages: [{ role: 'user', content: 'Extract the programming languages mentioned in this text: \'We use Python for ML, TypeScript for frontend, and Rust for our core engine.\'' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen/qwen3.5-9b", "messages": [{"role": "user", "content": "Extract the programming languages mentioned in this text: \"We use Python for ML, TypeScript for frontend, and Rust for our core engine.\""}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `qwen/qwen3.5-9b`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "qwen/qwen3.5-9b", "message": { "role": "assistant", "content": "The programming languages mentioned are: Python, TypeScript, and Rust." }, "usage": { "promptTokens": 34, "completionTokens": 14, "totalTokens": 48 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"The"},"model":"qwen/qwen3.5-9b","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Qwen 3.5 Flash *Source: ai-models/qwen/qwen3.5-flash-02-23.mdx* ## Overview Alibaba's fast inference model. Optimized for speed with a 1M context window at an ultra-low price. | Property | Value | | :--- | :--- | | Model ID | `qwen/qwen3.5-flash-02-23` | | Context Window | 1,000,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.065 / 1M tokens | | Output Price | $0.26 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'qwen/qwen3.5-flash-02-23', messages: [{ role: 'user', content: 'Summarize this paragraph in one sentence: \'Machine learning is a subset of AI that enables systems to learn from data without explicit programming.\'' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen/qwen3.5-flash-02-23", "messages": [{"role": "user", "content": "Summarize this paragraph in one sentence: \"Machine learning is a subset of AI that enables systems to learn from data without explicit programming.\""}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `qwen/qwen3.5-flash-02-23`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "qwen/qwen3.5-flash-02-23", "message": { "role": "assistant", "content": "Machine learning is an AI discipline where systems automatically improve their performance by learning patterns from data." }, "usage": { "promptTokens": 32, "completionTokens": 18, "totalTokens": 50 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Machine"},"model":"qwen/qwen3.5-flash-02-23","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Qwen 3.5 Plus *Source: ai-models/qwen/qwen3.5-plus-02-15.mdx* ## Overview Alibaba's previous flagship. Strong all-around performance with a 1M context window at an affordable price. | Property | Value | | :--- | :--- | | Model ID | `qwen/qwen3.5-plus-02-15` | | Context Window | 1,000,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.26 / 1M tokens | | Output Price | $1.56 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'qwen/qwen3.5-plus-02-15', messages: [{ role: 'user', content: 'Explain the difference between promises and async/await in JavaScript.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen/qwen3.5-plus-02-15", "messages": [{"role": "user", "content": "Explain the difference between promises and async/await in JavaScript."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `qwen/qwen3.5-plus-02-15`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "qwen/qwen3.5-plus-02-15", "message": { "role": "assistant", "content": "Promises use `.then()` chains for asynchronous operations, while async/await is syntactic sugar that lets you write asynchronous code in a synchronous style using the `await` keyword inside `async` functions." }, "usage": { "promptTokens": 17, "completionTokens": 41, "totalTokens": 58 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Promises"},"model":"qwen/qwen3.5-plus-02-15","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Qwen 3.6 Plus *Source: ai-models/qwen/qwen3.6-plus.mdx* ## Overview Alibaba's flagship model. Strong reasoning, multilingual capabilities, and a massive 1M context window at a budget-friendly price. | Property | Value | | :--- | :--- | | Model ID | `qwen/qwen3.6-plus` | | Context Window | 1,000,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.325 / 1M tokens | | Output Price | $1.95 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'qwen/qwen3.6-plus', messages: [{ role: 'user', content: 'Compare React, Vue, and Svelte for building a large-scale SaaS dashboard.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen/qwen3.6-plus", "messages": [{"role": "user", "content": "Compare React, Vue, and Svelte for building a large-scale SaaS dashboard."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `qwen/qwen3.6-plus`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "qwen/qwen3.6-plus", "message": { "role": "assistant", "content": "For a large-scale SaaS dashboard, React offers the largest ecosystem and hiring pool, Vue provides a gentler learning curve with excellent TypeScript support, and Svelte delivers the best runtime performance with minimal bundle size." }, "usage": { "promptTokens": 19, "completionTokens": 45, "totalTokens": 64 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"For"},"model":"qwen/qwen3.6-plus","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Step 3.5 Flash *Source: ai-models/stepfun/step-3.5-flash.mdx* ## Overview StepFun's fast inference model. Quick responses with a 262K context window at a very low price. | Property | Value | | :--- | :--- | | Model ID | `stepfun/step-3.5-flash` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.10 / 1M tokens | | Output Price | $0.30 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'stepfun/step-3.5-flash', messages: [{ role: 'user', content: 'Write a regular expression that matches valid IPv4 addresses.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "stepfun/step-3.5-flash", "messages": [{"role": "user", "content": "Write a regular expression that matches valid IPv4 addresses."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `stepfun/step-3.5-flash`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "stepfun/step-3.5-flash", "message": { "role": "assistant", "content": "Here's a regex for valid IPv4 addresses: ^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$ — each octet matches values from 0 to 255." }, "usage": { "promptTokens": 15, "completionTokens": 86, "totalTokens": 101 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Here's"},"model":"stepfun/step-3.5-flash","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Grok 4.1 Fast *Source: ai-models/x-ai/grok-4.1-fast.mdx* ## Overview xAI's fast and affordable model. 2M context window with rapid responses at a fraction of the flagship price. | Property | Value | | :--- | :--- | | Model ID | `x-ai/grok-4.1-fast` | | Context Window | 2,000,000 tokens | | Max Output | 16,384 tokens | | Input Price | $0.20 / 1M tokens | | Output Price | $0.50 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'x-ai/grok-4.1-fast', messages: [{ role: 'user', content: 'Summarize the key differences between REST and GraphQL APIs.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "x-ai/grok-4.1-fast", "messages": [{"role": "user", "content": "Summarize the key differences between REST and GraphQL APIs."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `x-ai/grok-4.1-fast`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "x-ai/grok-4.1-fast", "message": { "role": "assistant", "content": "REST uses fixed endpoints with predefined data shapes, while GraphQL provides a single endpoint where clients specify exactly what data they need, reducing over-fetching and under-fetching." }, "usage": { "promptTokens": 16, "completionTokens": 38, "totalTokens": 54 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"REST"},"model":"x-ai/grok-4.1-fast","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Grok 4.20 Multi-Agent *Source: ai-models/x-ai/grok-4.20-multi-agent.mdx* ## Overview xAI's multi-agent variant. Optimized for orchestrating complex multi-step workflows with the same 2M context window as Grok 4.20. | Property | Value | | :--- | :--- | | Model ID | `x-ai/grok-4.20-multi-agent` | | Context Window | 2,000,000 tokens | | Max Output | 16,384 tokens | | Input Price | $2.00 / 1M tokens | | Output Price | $6.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'x-ai/grok-4.20-multi-agent', messages: [{ role: 'user', content: 'Break down building a SaaS product from idea to launch into parallel workstreams.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "x-ai/grok-4.20-multi-agent", "messages": [{"role": "user", "content": "Break down building a SaaS product from idea to launch into parallel workstreams."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `x-ai/grok-4.20-multi-agent`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "x-ai/grok-4.20-multi-agent", "message": { "role": "assistant", "content": "Here are four parallel workstreams for your SaaS launch: (1) Product & Engineering — MVP scoping, architecture, and iterative development; (2) Design & UX — user research, wireframes, and design system; (3) Go-to-Market — landing page, waitlist, and content strategy; (4) Operations — billing integration, monitoring, and support tooling." }, "usage": { "promptTokens": 18, "completionTokens": 68, "totalTokens": 86 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Here"},"model":"x-ai/grok-4.20-multi-agent","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Grok 4.20 *Source: ai-models/x-ai/grok-4.20.mdx* ## Overview xAI's flagship model. Industry-leading 2M token context window with strong reasoning, real-time knowledge, and competitive output pricing. | Property | Value | | :--- | :--- | | Model ID | `x-ai/grok-4.20` | | Context Window | 2,000,000 tokens | | Max Output | 16,384 tokens | | Input Price | $2.00 / 1M tokens | | Output Price | $6.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'x-ai/grok-4.20', messages: [{ role: 'user', content: 'What are the most important recent developments in AI?' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "x-ai/grok-4.20", "messages": [{"role": "user", "content": "What are the most important recent developments in AI?"}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `x-ai/grok-4.20`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "x-ai/grok-4.20", "message": { "role": "assistant", "content": "The most significant recent AI developments include breakthroughs in multimodal reasoning, the rise of open-weight models competing with proprietary ones, and the emergence of AI agents capable of autonomous multi-step task completion." }, "usage": { "promptTokens": 15, "completionTokens": 42, "totalTokens": 57 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"The"},"model":"x-ai/grok-4.20","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## MiMo V2 Flash *Source: ai-models/xiaomi/mimo-v2-flash.mdx* ## Overview Xiaomi's fast and affordable model. Optimized for speed with a 262K context window at a budget price. | Property | Value | | :--- | :--- | | Model ID | `xiaomi/mimo-v2-flash` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.09 / 1M tokens | | Output Price | $0.29 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'xiaomi/mimo-v2-flash', messages: [{ role: 'user', content: 'Convert this temperature from Celsius to Fahrenheit: 37 degrees.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "xiaomi/mimo-v2-flash", "messages": [{"role": "user", "content": "Convert this temperature from Celsius to Fahrenheit: 37 degrees."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `xiaomi/mimo-v2-flash`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "xiaomi/mimo-v2-flash", "message": { "role": "assistant", "content": "37 degrees Celsius is equal to 98.6 degrees Fahrenheit. The formula is: F = (C x 9/5) + 32." }, "usage": { "promptTokens": 16, "completionTokens": 32, "totalTokens": 48 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"37"},"model":"xiaomi/mimo-v2-flash","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## MiMo V2 Omni *Source: ai-models/xiaomi/mimo-v2-omni.mdx* ## Overview Xiaomi's multimodal model. Handles text, code, and vision tasks with a 262K context window at a moderate price. | Property | Value | | :--- | :--- | | Model ID | `xiaomi/mimo-v2-omni` | | Context Window | 262,144 tokens | | Max Output | 8,192 tokens | | Input Price | $0.40 / 1M tokens | | Output Price | $2.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'xiaomi/mimo-v2-omni', messages: [{ role: 'user', content: 'Explain the concept of dependency injection with a practical example.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "xiaomi/mimo-v2-omni", "messages": [{"role": "user", "content": "Explain the concept of dependency injection with a practical example."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `xiaomi/mimo-v2-omni`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "xiaomi/mimo-v2-omni", "message": { "role": "assistant", "content": "Dependency injection is a design pattern where an object receives its dependencies from external sources rather than creating them internally. For example, instead of a UserService creating its own DatabaseConnection, you pass one in through the constructor." }, "usage": { "promptTokens": 15, "completionTokens": 164, "totalTokens": 179 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Dependency"},"model":"xiaomi/mimo-v2-omni","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## MiMo V2 Pro *Source: ai-models/xiaomi/mimo-v2-pro.mdx* ## Overview Xiaomi's flagship AI model. Strong reasoning and code generation with a massive 1M context window. | Property | Value | | :--- | :--- | | Model ID | `xiaomi/mimo-v2-pro` | | Context Window | 1,000,000 tokens | | Max Output | 8,192 tokens | | Input Price | $1.00 / 1M tokens | | Output Price | $3.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'xiaomi/mimo-v2-pro', messages: [{ role: 'user', content: 'Design a caching strategy for a high-traffic REST API.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "xiaomi/mimo-v2-pro", "messages": [{"role": "user", "content": "Design a caching strategy for a high-traffic REST API."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `xiaomi/mimo-v2-pro`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "xiaomi/mimo-v2-pro", "message": { "role": "assistant", "content": "A multi-layer caching strategy works best: use CDN edge caching for static responses, Redis for frequently accessed data with TTL-based invalidation, and application-level memoization for computed results." }, "usage": { "promptTokens": 14, "completionTokens": 186, "totalTokens": 200 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"A"},"model":"xiaomi/mimo-v2-pro","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GLM 5 Turbo *Source: ai-models/z-ai/glm-5-turbo.mdx* ## Overview Zhipu's fast inference model. Optimized for speed with a 203K context window. | Property | Value | | :--- | :--- | | Model ID | `z-ai/glm-5-turbo` | | Context Window | 203,000 tokens | | Max Output | 8,192 tokens | | Input Price | $1.20 / 1M tokens | | Output Price | $4.00 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'z-ai/glm-5-turbo', messages: [{ role: 'user', content: 'List the top 5 design patterns used in modern web applications.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "z-ai/glm-5-turbo", "messages": [{"role": "user", "content": "List the top 5 design patterns used in modern web applications."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `z-ai/glm-5-turbo`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "z-ai/glm-5-turbo", "message": { "role": "assistant", "content": "The top 5 design patterns in modern web apps are: 1) MVC/MVVM for separation of concerns, 2) Observer/Pub-Sub for event-driven architectures, 3) Singleton for shared state management, 4) Factory for component creation, and 5) Strategy for swappable algorithms." }, "usage": { "promptTokens": 16, "completionTokens": 142, "totalTokens": 158 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"The"},"model":"z-ai/glm-5-turbo","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GLM 5.1 *Source: ai-models/z-ai/glm-5.1.mdx* ## Overview Zhipu's latest flagship model. Strong reasoning and multilingual capabilities with a 203K context window. | Property | Value | | :--- | :--- | | Model ID | `z-ai/glm-5.1` | | Context Window | 203,000 tokens | | Max Output | 8,192 tokens | | Input Price | $1.26 / 1M tokens | | Output Price | $3.96 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'z-ai/glm-5.1', messages: [{ role: 'user', content: 'Explain the concept of attention mechanisms in neural networks.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "z-ai/glm-5.1", "messages": [{"role": "user", "content": "Explain the concept of attention mechanisms in neural networks."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `z-ai/glm-5.1`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "z-ai/glm-5.1", "message": { "role": "assistant", "content": "Attention mechanisms allow neural networks to dynamically focus on the most relevant parts of an input sequence when producing each element of the output, computing weighted sums based on learned relevance scores." }, "usage": { "promptTokens": 14, "completionTokens": 168, "totalTokens": 182 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Attention"},"model":"z-ai/glm-5.1","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## GLM 5 *Source: ai-models/z-ai/glm-5.mdx* ## Overview Zhipu's general-purpose model. Reliable performance for a wide range of tasks with competitive pricing. | Property | Value | | :--- | :--- | | Model ID | `z-ai/glm-5` | | Context Window | 80,000 tokens | | Max Output | 8,192 tokens | | Input Price | $0.72 / 1M tokens | | Output Price | $2.30 / 1M tokens | ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/ai/chat', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'z-ai/glm-5', messages: [{ role: 'user', content: 'Write a professional email declining a meeting invitation politely.' }], }), }); const { data } = await res.json(); console.log(data.message.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/ai/chat \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "z-ai/glm-5", "messages": [{"role": "user", "content": "Write a professional email declining a meeting invitation politely."}]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `model` | `string` | Yes | Model ID (e.g. `z-ai/glm-5`) | — | | `messages` | `Message[]` | Yes | Array of `{ role, content }` objects | — | | `maxTokens` | `number` | No | Maximum tokens in the response | Model default | | `temperature` | `number` | No | Sampling temperature (0.0–2.0) | `1.0` | | `topP` | `number` | No | Nucleus sampling threshold | `1.0` | | `frequencyPenalty` | `number` | No | Penalize repeated tokens | `0` | | `presencePenalty` | `number` | No | Penalize tokens already present | `0` | | `stream` | `boolean` | No | Enable SSE streaming | `false` | > All AI models use the `/v1/ai/chat` endpoint. Specify the model with the `model` field. ### Response **Response:** ```json { "ok": true, "data": { "model": "z-ai/glm-5", "message": { "role": "assistant", "content": "Subject: Re: Meeting Invitation\n\nThank you for the invitation. Unfortunately, I have a prior commitment at that time and won't be able to attend. I'd appreciate it if you could share the meeting notes afterward." }, "usage": { "promptTokens": 14, "completionTokens": 96, "totalTokens": 110 } } } ``` ### Streaming Set `"stream": true` to receive Server-Sent Events. Each chunk contains a `delta` object: ```json data: {"delta":{"content":"Subject"},"model":"z-ai/glm-5","index":0} data: [DONE] ``` > We handle auth, billing, and response normalization — you just send messages. --- ## Brand Visibility *Source: ai-visibility/brand-visibility.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/ai-visibility', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ brand: 'vercel', competitors: ['netlify', 'cloudflare pages'], }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/ai-visibility \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"brand": "vercel", "competitors": ["netlify", "cloudflare pages"]}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `brand` | `string` | Yes | Your brand name to track | — | | `competitors` | `string[]` | No | Competitor brands to compare | `[]` | ### Response **Response:** ```json { "ok": true, "data": { "brand": "vercel", "engines": [ { "engine": "perplexity", "mentionRate": 0.85, "sentiment": "positive", "rank": 1 }, { "engine": "chatgpt", "mentionRate": 0.72, "sentiment": "positive", "rank": 1 }, { "engine": "claude", "mentionRate": 0.68, "sentiment": "positive", "rank": 2 }, { "engine": "gemini", "mentionRate": 0.55, "sentiment": "neutral", "rank": 3 } ], "competitors": [ { "brand": "netlify", "averageMentionRate": 0.45 }, { "brand": "cloudflare pages", "averageMentionRate": 0.38 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.brand` | `string` | The brand name that was tracked | | `data.engines` | `object[]` | Visibility data for each AI engine | | `data.engines[].engine` | `string` | AI engine name (`perplexity`, `chatgpt`, `claude`, or `gemini`) | | `data.engines[].mentionRate` | `number` | How frequently the brand is mentioned (0 to 1) | | `data.engines[].sentiment` | `string` | Overall sentiment of mentions (`positive`, `neutral`, or `negative`) | | `data.engines[].rank` | `number` | Brand ranking position relative to competitors on this engine | | `data.competitors` | `object[]` | Competitor comparison data | | `data.competitors[].brand` | `string` | Competitor brand name | | `data.competitors[].averageMentionRate` | `number` | Average mention rate across all engines for this competitor | > Powered by our visibility tracking engine. We normalize the response format and add cross-engine comparison metrics. We query multiple AI engines and normalize the results. --- ## Prompt Discovery *Source: ai-visibility/prompt-discovery.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/ai-visibility/prompts', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ brand: 'devkit', category: 'developer tools', }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/ai-visibility/prompts \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"brand": "devkit", "category": "developer tools"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `brand` | `string` | Yes | Brand to discover prompts for | — | | `category` | `string` | No | Industry or category to focus on | — | ### Response **Response:** ```json { "ok": true, "data": { "brand": "devkit", "prompts": [ { "prompt": "What are the best SEO APIs for developers?", "engines": ["chatgpt", "perplexity"], "brandMentioned": true, "position": 3, "context": "YepAPI is mentioned as a unified API wrapper..." }, { "prompt": "best api for keyword research", "engines": ["perplexity", "gemini"], "brandMentioned": true, "position": 5, "context": "For a simpler approach, YepAPI provides keyword data..." } ], "totalPrompts": 24, "mentionRate": 0.42 } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.brand` | `string` | The brand name that was analyzed | | `data.prompts` | `object[]` | List of discovered prompts that trigger brand mentions | | `data.prompts[].prompt` | `string` | The prompt or question that triggers a brand mention | | `data.prompts[].engines` | `string[]` | AI engines where the brand appears for this prompt | | `data.prompts[].brandMentioned` | `boolean` | Whether the brand was mentioned in the AI response | | `data.prompts[].position` | `number` | Position of the brand mention within the AI response | | `data.prompts[].context` | `string` | Excerpt of the AI response showing how the brand is mentioned | | `data.totalPrompts` | `number` | Total number of prompts analyzed | | `data.mentionRate` | `number` | Fraction of analyzed prompts where the brand was mentioned (0 to 1) | > This is a YepAPI-exclusive feature. Use it to understand how AI models perceive your brand and optimize your content to appear in more AI-generated answers. --- ## Best Sellers *Source: amazon-api/best-sellers.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/amazon/best-sellers', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ category: 'software', type: 'BEST_SELLERS' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/amazon/best-sellers \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"category": "software", "type": "BEST_SELLERS"}' ``` ```python import requests res = requests.post( "https://api.yepapi.com/v1/amazon/best-sellers", headers={"x-api-key": "YOUR_API_KEY"}, json={"category": "software", "type": "BEST_SELLERS"}, ) print(res.json()["data"]) ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `category` | `string` | Yes | Amazon leaf category slug (e.g. `software`, `home-garden`) — see `/v1/amazon/categories` | — | | `country` | `string` | No | ISO alpha-2 country code | `US` | | `type` | `string` | No | `BEST_SELLERS`, `HOT_NEW_RELEASES`, `HIGH_RATED` | `BEST_SELLERS` | | `page` | `number` | No | Page number (50 items/page) | `1` | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "request_id": "ccb92b08-2845-4f7d-a2c5-aa9ef0bd5e85", "parameters": { "country": "US", "type": "BEST_SELLERS", "page": 1, "category": "software" }, "data": { "best_sellers": [ { "rank": 1, "asin": "B0FWV56H48", "product_title": "TurboTax Deluxe Desktop Edition 2025, Federal & State Tax Return [Win11/Mac14 Download]", "product_price": "$79.99", "product_star_rating": "3.7", "product_num_ratings": 4969, "product_url": "https://www.amazon.com/dp/B0FWV56H48", "product_photo": "https://images-na.ssl-images-amazon.com/images/I/71OcM906MLL._AC_UL900_SR900,600_.jpg", "rank_change_label": null }, { "rank": 2, "asin": "B0FRPW868X", "product_title": "H&R Block Tax Software Deluxe + State 2025 Win/Mac", "product_price": "$49.97", "product_star_rating": "3.8", "product_num_ratings": 2300, "product_url": "https://www.amazon.com/dp/B0FRPW868X", "product_photo": "https://images-na.ssl-images-amazon.com/images/I/611uM-FzipL._AC_UL900_SR900,600_.jpg", "rank_change_label": null } ] } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data.best_sellers[].rank` | `number` | 1-based rank within the category | | `data.data.best_sellers[].asin` | `string` | ASIN | | `data.data.best_sellers[].product_title` | `string` | Title | | `data.data.best_sellers[].product_price` | `string` | Current price | | `data.data.best_sellers[].product_star_rating` | `string` | Average rating | | `data.data.best_sellers[].product_num_ratings` | `number` | Rating count | | `data.data.best_sellers[].product_url` | `string` | Product URL | | `data.data.best_sellers[].product_photo` | `string` | Image URL | | `data.data.best_sellers[].rank_change_label` | `string \| null` | e.g. `"+3"` or `null` if unchanged | --- ## Categories *Source: amazon-api/categories.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/amazon/categories', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ country: 'US' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/amazon/categories \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"country": "US"}' ``` ```python import requests res = requests.post( "https://api.yepapi.com/v1/amazon/categories", headers={"x-api-key": "YOUR_API_KEY"}, json={"country": "US"}, ) print(res.json()["data"]) ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `country` | `string` | No | ISO alpha-2 country code | `US` | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "request_id": "e2a81e08-6840-48e0-b793-8490cd956386", "parameters": { "country": "US" }, "data": [ { "name": "All Departments", "id": "aps" }, { "name": "Alexa Skills", "id": "alexa-skills" }, { "name": "Amazon Devices", "id": "amazon-devices" }, { "name": "Appliances", "id": "appliances" }, { "name": "Baby", "id": "baby-products" }, { "name": "Beauty & Personal Care", "id": "beauty" }, { "name": "Books", "id": "stripbooks" }, { "name": "Cell Phones & Accessories", "id": "mobile" }, { "name": "Clothing, Shoes & Jewelry", "id": "fashion" }, { "name": "Electronics", "id": "electronics" }, { "name": "Home & Kitchen", "id": "garden" }, { "name": "Software", "id": "software" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data` | `array` | Ordered list of top-level category nodes | | `data.data[].name` | `string` | Display name (may include leading whitespace for nested subcategories) | | `data.data[].id` | `string` | Category slug/ID (e.g. `stripbooks`, `software`) used by `/best-sellers` | > These IDs are the Amazon leaf slugs used by `/v1/amazon/best-sellers`. They differ from the numeric browse-node IDs used by `/v1/amazon/products-by-category` (e.g. `2478868012`). --- ## Deals *Source: amazon-api/deals.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/amazon/deals', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ country: 'US', page: 1 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/amazon/deals \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"country": "US", "page": 1}' ``` ```python import requests res = requests.post( "https://api.yepapi.com/v1/amazon/deals", headers={"x-api-key": "YOUR_API_KEY"}, json={"country": "US", "page": 1}, ) print(res.json()["data"]) ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `country` | `string` | No | ISO alpha-2 country code | `US` | | `page` | `number` | No | Page number (30 deals/page) | `1` | | `price_range` | `string` | No | Filter like `ALL`, `UNDER_25`, `25_50`, `50_100`, `OVER_100` | `ALL` | | `discount_range` | `string` | No | `ALL`, `10_OFF`, `25_OFF`, `50_OFF`, `70_OFF` | `ALL` | | `deal_type` | `string` | No | e.g. `BEST_DEAL`, `LIGHTNING_DEAL` | — | | `category` | `string` | No | Amazon category slug | — | | `min_rating` | `string` | No | Minimum star rating filter | — | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "request_id": "01ad1c29-5bf1-4f80-b321-009f1a64fa4e", "parameters": { "country": "US", "price_range": "ALL", "discount_range": "ALL" }, "data": { "deals": [ { "deal_id": "64fc3cf8", "deal_type": "BEST_DEAL", "deal_title": "Ring Battery Doorbell, Head-to-Toe Video, Live View with Two-Way Talk", "deal_photo": "https://m.media-amazon.com/images/I/51IswCEoJXL.jpg", "deal_state": "AVAILABLE", "deal_url": "https://www.amazon.com/Ring-Battery-Doorbell/dp/B0BZWRSRWV", "canonical_deal_url": "https://www.amazon.com/deal/64fc3cf8", "deal_starts_at": null, "deal_ends_at": null, "deal_price": { "amount": 59.99, "currency": "USD" }, "list_price": { "amount": 99.99, "currency": "USD" }, "savings_percentage": 40, "savings_amount": { "amount": 40, "currency": "USD" }, "deal_badge": "40% off", "type": "MULTI_ASIN", "product_asin": "B0BZWRSRWV" } ] } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data.deals[].deal_id` | `string` | Amazon deal ID | | `data.data.deals[].deal_type` | `string` | `BEST_DEAL`, `LIGHTNING_DEAL`, etc. | | `data.data.deals[].deal_title` | `string` | Deal title | | `data.data.deals[].deal_photo` | `string` | Image URL | | `data.data.deals[].deal_state` | `string` | `AVAILABLE`, `EXPIRED`, etc. | | `data.data.deals[].deal_url` | `string` | Direct product URL | | `data.data.deals[].canonical_deal_url` | `string` | Canonical Amazon deal URL | | `data.data.deals[].deal_starts_at` | `string \| null` | ISO timestamp | | `data.data.deals[].deal_ends_at` | `string \| null` | ISO timestamp | | `data.data.deals[].deal_price.amount` | `number` | Deal price amount | | `data.data.deals[].deal_price.currency` | `string` | ISO currency code | | `data.data.deals[].list_price.amount` | `number` | Original list price | | `data.data.deals[].savings_percentage` | `number` | Percent off | | `data.data.deals[].savings_amount.amount` | `number` | Absolute savings | | `data.data.deals[].deal_badge` | `string` | Formatted badge (e.g. `"40% off"`) | | `data.data.deals[].product_asin` | `string` | ASIN of the featured product | --- ## Influencer Profile *Source: amazon-api/influencer.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/amazon/influencer', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ influencer_name: 'amazonhaul' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/amazon/influencer \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"influencer_name": "amazonhaul"}' ``` ```python import requests res = requests.post( "https://api.yepapi.com/v1/amazon/influencer", headers={"x-api-key": "YOUR_API_KEY"}, json={"influencer_name": "amazonhaul"}, ) print(res.json()["data"]) ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `influencer_name` | `string` | Yes | Influencer's Amazon username (part after `/shop/`) | — | | `country` | `string` | No | ISO alpha-2 country code | `US` | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "request_id": "d245f5ee-8ca3-488e-9224-69336c6245fd", "parameters": { "influencer_name": "amazonhaul", "country": "US" }, "data": { "name": null, "country": "US", "domain": "www.amazon.com", "profile_link": "https://www.amazon.com/shop/amazonhaul", "affiliate_status": null, "has_curations": false } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data.name` | `string \| null` | Influencer display name (may be `null` for thin profiles) | | `data.data.country` | `string` | Country scope | | `data.data.domain` | `string` | Amazon domain | | `data.data.profile_link` | `string` | Canonical storefront URL | | `data.data.affiliate_status` | `string \| null` | Affiliate program tier, if surfaced | | `data.data.has_curations` | `boolean` | Whether the profile has curated idea lists / collections | > When an influencer name is blocked or the upstream scrape fails, the RapidAPI source returns HTTP 200 with `{"status": "ERROR", "error": {"code": 503}}`. YepAPI detects this envelope and maps it to HTTP 502 `UPSTREAM_ERROR`. Thin but valid profiles (like the sample above) pass through with most fields as `null`. --- ## Product Offers *Source: amazon-api/product-offers.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/amazon/product-offers', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ asin: 'B07ZPKBL9V', limit: 100 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/amazon/product-offers \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"asin": "B07ZPKBL9V", "limit": 100}' ``` ```python import requests res = requests.post( "https://api.yepapi.com/v1/amazon/product-offers", headers={"x-api-key": "YOUR_API_KEY"}, json={"asin": "B07ZPKBL9V", "limit": 100}, ) print(res.json()["data"]) ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `asin` | `string` | Yes | Amazon ASIN | — | | `country` | `string` | No | ISO alpha-2 country code | `US` | | `limit` | `number` | No | Max offers (1–100) | `100` | | `page` | `number` | No | Page number | `1` | | `product_condition` | `string` | No | `ALL`, `NEW`, `USED`, `RENEWED`, `COLLECTIBLE` | `ALL` | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "request_id": "c9845825-48ba-4503-8890-ad17805df07c", "parameters": { "asin": "B07ZPKBL9V", "country": "US", "limit": 100, "page": 1 }, "data": { "asin": "B07ZPKBL9V", "product_title": "Apple iPhone 11, 64GB, PRODUCT RED - Unlocked (Renewed)", "product_price": "169.00", "product_original_price": "$174.64", "delivery_price": "FREE", "currency": "USD", "country": "US", "domain": "www.amazon.com", "product_byline": "Visit the Amazon Renewed Store", "product_star_rating": "4.2", "product_num_ratings": 59992, "product_url": "https://www.amazon.com/dp/B07ZPKBL9V", "product_num_offers": 33, "product_availability": "Only 16 left in stock - order soon.", "product_condition": "Refurbished - Excellent", "is_prime": false, "buy_boxes": [], "sales_volume": "200+ bought in past month" } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data.asin` | `string` | Product ASIN | | `data.data.product_title` | `string` | Product title | | `data.data.product_price` | `string` | Headline price | | `data.data.product_original_price` | `string \| null` | MSRP if discounted | | `data.data.delivery_price` | `string` | Shipping cost shown (e.g. `"FREE"`) | | `data.data.currency` | `string` | ISO currency code | | `data.data.product_byline` | `string` | Seller/brand byline | | `data.data.product_num_offers` | `number` | Total offers available | | `data.data.product_availability` | `string` | Stock status message | | `data.data.product_condition` | `string` | Condition of the featured offer | | `data.data.buy_boxes` | `array` | Structured buy-box offers (varies by product) | | `data.data.is_prime` | `boolean` | Featured offer is Prime | | `data.data.sales_volume` | `string \| null` | e.g. `"200+ bought in past month"` | > This endpoint is one of the largest Amazon payloads (~35–40 KB). Use short TTL caching if you need fresh buy-box prices, or pass `limit` to cap offer count. --- ## Product Reviews *Source: amazon-api/product-reviews.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/amazon/product-reviews', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ asin: 'B07ZPKBL9V', sort_by: 'TOP_REVIEWS' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/amazon/product-reviews \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"asin": "B07ZPKBL9V", "sort_by": "TOP_REVIEWS"}' ``` ```python import requests res = requests.post( "https://api.yepapi.com/v1/amazon/product-reviews", headers={"x-api-key": "YOUR_API_KEY"}, json={"asin": "B07ZPKBL9V", "sort_by": "TOP_REVIEWS"}, ) print(res.json()["data"]) ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `asin` | `string` | Yes | Amazon ASIN | — | | `country` | `string` | No | ISO alpha-2 country code | `US` | | `sort_by` | `string` | No | `TOP_REVIEWS` or `MOST_RECENT` | `TOP_REVIEWS` | | `star_rating` | `string` | No | `ALL`, `5_STARS`, `4_STARS`, `3_STARS`, `2_STARS`, `1_STARS`, `POSITIVE`, `CRITICAL` | `ALL` | | `verified_purchases_only` | `boolean` | No | Only verified purchasers | `false` | | `images_or_videos_only` | `boolean` | No | Only reviews with media | `false` | | `current_format_only` | `boolean` | No | Only reviews for the current format/variation | `false` | | `page` | `number` | No | Page number (7 reviews/page) | `1` | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "request_id": "272b8277-8deb-46c3-99ff-1948bcc081d8", "parameters": { "asin": "B07ZPKBL9V", "sort_by": "TOP_REVIEWS", "star_rating": "ALL", "page": 1 }, "data": { "asin": "B07ZPKBL9V", "country": "US", "domain": "www.amazon.com", "total_ratings": 59992, "rating_distribution": { "1": 11, "2": 3, "3": 5, "4": 12, "5": 69 }, "reviews": [ { "review_id": "RY89LJI770S2T", "review_title": "Great price", "review_comment": "Perfect replacement for my 13 year old daughter. Works perfectly.", "review_star_rating": "5", "review_link": "https://www.amazon.com/gp/customer-reviews/RY89LJI770S2T", "review_author": "JEKurtz", "review_author_avatar": "https://m.media-amazon.com/images/S/amazon-avatars-global/default.png", "review_images": [], "review_video": null, "review_date": "Reviewed in the United States on March 8, 2026", "is_verified_purchase": true, "helpful_vote_statement": "5 people found this helpful", "reviewed_product_asin": "B07ZPKBL9V", "reviewed_product_variant": { "Size": "64GB", "Color": "White", "Service provider": "Unlocked", "Product grade": "Renewed" }, "is_vine": false } ] } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data.asin` | `string` | Product ASIN | | `data.data.total_ratings` | `number` | Total ratings across all pages | | `data.data.rating_distribution` | `object` | Percent per star rating (`"1"` → `"5"`) | | `data.data.reviews[].review_id` | `string` | Amazon review ID | | `data.data.reviews[].review_title` | `string` | Review title | | `data.data.reviews[].review_comment` | `string` | Review body text | | `data.data.reviews[].review_star_rating` | `string` | Star rating (1–5) | | `data.data.reviews[].review_link` | `string` | Deep link to review on Amazon | | `data.data.reviews[].review_author` | `string` | Author display name | | `data.data.reviews[].review_images` | `string[]` | Uploaded image URLs (may be empty) | | `data.data.reviews[].review_date` | `string` | Localized review date string | | `data.data.reviews[].is_verified_purchase` | `boolean` | Verified-purchase badge | | `data.data.reviews[].helpful_vote_statement` | `string` | "N people found this helpful" | | `data.data.reviews[].reviewed_product_variant` | `object` | Variant attributes (Size, Color, etc.) | | `data.data.reviews[].is_vine` | `boolean` | Amazon Vine program review | --- ## Product Details *Source: amazon-api/product.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/amazon/product', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ asin: 'B07ZPKBL9V', country: 'US' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/amazon/product \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"asin": "B07ZPKBL9V", "country": "US"}' ``` ```python import requests res = requests.post( "https://api.yepapi.com/v1/amazon/product", headers={"x-api-key": "YOUR_API_KEY"}, json={"asin": "B07ZPKBL9V", "country": "US"}, ) print(res.json()["data"]) ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `asin` | `string` | Yes | Amazon Standard Identification Number (e.g. `B07ZPKBL9V`) | — | | `country` | `string` | No | ISO alpha-2 country code | `US` | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "request_id": "56ba58ed-368d-4cf5-8322-6e34a7d0e3d6", "parameters": { "asin": "B07ZPKBL9V", "country": "US" }, "data": { "asin": "B07ZPKBL9V", "product_title": "Apple iPhone 11, 64GB, PRODUCT RED - Unlocked (Renewed)", "product_price": "169.00", "product_original_price": "$174.64", "delivery_price": "FREE", "currency": "USD", "country": "US", "domain": "www.amazon.com", "product_byline": "Visit the Amazon Renewed Store", "product_star_rating": "4.2", "product_num_ratings": 59992, "product_url": "https://www.amazon.com/dp/B07ZPKBL9V", "product_photo": "https://m.media-amazon.com/images/I/514k7uOBMwL._AC_SL1000_.jpg", "product_num_offers": 33, "product_availability": "Only 16 left in stock - order soon.", "product_condition": "Refurbished - Excellent", "offer_box_title": "Refurbished - Good", "offer_box_price": "$159.00", "is_best_seller": false, "is_amazon_choice": false, "is_prime": false, "sales_volume": "200+ bought in past month", "about_product": [ "Unlocked and compatible with any carrier of choice on GSM and CDMA networks.", "Tested for battery health and guaranteed minimum 80% capacity.", "Passed a full diagnostic test ensuring like-new functionality." ], "product_description": "The iPhone 11 features a 6.1-inch LCD 'Liquid Retina HD Display' at 326ppi with True Tone and wide color support.", "product_information": { "Operating System": "iOS 16", "RAM Memory Installed": "4 GB", "Memory Storage Capacity": "64 GB", "Color": "(PRODUCT) RED", "Form Factor": "Smartphone" } } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data.asin` | `string` | Product ASIN | | `data.data.product_title` | `string` | Full title as shown on Amazon | | `data.data.product_price` | `string` | Current price (formatted or numeric string) | | `data.data.product_original_price` | `string \| null` | MSRP if discounted | | `data.data.delivery_price` | `string` | Shipping cost (e.g. `"FREE"`) | | `data.data.currency` | `string` | ISO currency code | | `data.data.product_byline` | `string` | Seller/brand byline | | `data.data.product_star_rating` | `string` | Average rating | | `data.data.product_num_ratings` | `number` | Rating count | | `data.data.product_num_offers` | `number` | Number of third-party offers | | `data.data.product_availability` | `string` | Stock status message | | `data.data.product_condition` | `string` | `New`, `Refurbished - Excellent`, etc. | | `data.data.offer_box_price` | `string` | Buy-box price | | `data.data.is_prime` | `boolean` | Prime-eligible | | `data.data.sales_volume` | `string \| null` | e.g. `"200+ bought in past month"` | | `data.data.about_product` | `string[]` | Bullet-point feature list | | `data.data.product_description` | `string` | Long description | | `data.data.product_information` | `object` | Key/value spec map (OS, RAM, color, etc.) | --- ## Products by Category *Source: amazon-api/products-by-category.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/amazon/products-by-category', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ category_id: '2478868012', country: 'US' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/amazon/products-by-category \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"category_id": "2478868012", "country": "US"}' ``` ```python import requests res = requests.post( "https://api.yepapi.com/v1/amazon/products-by-category", headers={"x-api-key": "YOUR_API_KEY"}, json={"category_id": "2478868012", "country": "US"}, ) print(res.json()["data"]) ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `category_id` | `string` | Yes | Amazon category browse-node ID (numeric) | — | | `country` | `string` | No | ISO alpha-2 country code | `US` | | `sort_by` | `string` | No | `RELEVANCE`, `LOWEST_PRICE`, `HIGHEST_PRICE`, `REVIEWS`, `NEWEST`, `BEST_SELLERS` | `RELEVANCE` | | `product_condition` | `string` | No | `ALL`, `NEW`, `USED`, `RENEWED`, `COLLECTIBLE` | `ALL` | | `page` | `number` | No | Page number (48 products/page) | `1` | | `is_prime` | `boolean` | No | Only Prime-eligible | — | | `deals_and_discounts` | `string` | No | Discount filter | — | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "request_id": "6dc35479-a1dc-45d4-828d-978ec94ebe61", "parameters": { "category_id": "2478868012", "country": "US", "sort_by": "RELEVANCE", "page": 1 }, "data": { "total_products": 975521, "country": "US", "domain": "www.amazon.com", "products": [ { "asin": "168281808X", "product_title": "Untitled Empyrean (Not Book Four)", "product_price": "$17.49", "product_original_price": "$24.99", "currency": "USD", "product_star_rating": null, "product_num_ratings": 0, "book_format": "Hardcover", "product_url": "https://www.amazon.com/dp/168281808X", "product_photo": "https://m.media-amazon.com/images/I/716ogrQC-4L._AC_UL960_QL65_.jpg", "product_num_offers": 1, "product_minimum_offer_price": "$17.49", "is_best_seller": false, "is_amazon_choice": false, "is_prime": false, "has_variations": false } ] } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data.total_products` | `number` | Total products in the category | | `data.data.country` | `string` | Country scoped to | | `data.data.domain` | `string` | Amazon domain | | `data.data.products[].asin` | `string` | ASIN | | `data.data.products[].product_title` | `string` | Title | | `data.data.products[].product_price` | `string` | Current price | | `data.data.products[].product_original_price` | `string \| null` | MSRP if discounted | | `data.data.products[].currency` | `string` | ISO currency code | | `data.data.products[].product_star_rating` | `string \| null` | Average rating | | `data.data.products[].book_format` | `string` | Present for books (Hardcover, Paperback, etc.) | | `data.data.products[].product_url` | `string` | Amazon URL | | `data.data.products[].product_photo` | `string` | Image URL | | `data.data.products[].product_num_offers` | `number` | Third-party offer count | | `data.data.products[].product_minimum_offer_price` | `string` | Lowest available price across offers | | `data.data.products[].is_amazon_choice` | `boolean` | Amazon's Choice badge | | `data.data.products[].is_prime` | `boolean` | Prime-eligible | | `data.data.products[].has_variations` | `boolean` | Has variations | --- ## Search *Source: amazon-api/search.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/amazon/search', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'Phone', country: 'US' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/amazon/search \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "Phone", "country": "US"}' ``` ```python import requests res = requests.post( "https://api.yepapi.com/v1/amazon/search", headers={"x-api-key": "YOUR_API_KEY"}, json={"query": "Phone", "country": "US"}, ) print(res.json()["data"]) ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search keywords | — | | `page` | `number` | No | Page number (1-based) | `1` | | `country` | `string` | No | ISO alpha-2 country code (US, GB, DE, CA, AU, IN, JP, FR, IT, ES, etc.) | `US` | | `sort_by` | `string` | No | `RELEVANCE`, `LOWEST_PRICE`, `HIGHEST_PRICE`, `REVIEWS`, `NEWEST`, `BEST_SELLERS` | `RELEVANCE` | | `product_condition` | `string` | No | `ALL`, `NEW`, `USED`, `RENEWED`, `COLLECTIBLE` | `ALL` | | `is_prime` | `boolean` | No | Only return Prime-eligible products | — | | `deals_and_discounts` | `string` | No | Filter for discount tiers (e.g. `ALL_DISCOUNTS`) | — | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "request_id": "15a2016d-c6a2-4b15-ab0b-7764d1cd25c1", "parameters": { "query": "Phone", "country": "US", "sort_by": "RELEVANCE", "page": 1 }, "data": { "total_products": 135961, "country": "US", "domain": "www.amazon.com", "products": [ { "asin": "B0DM1S54MZ", "product_title": "Samsung Galaxy A16 4G LTE (128GB + 4GB) International Model, Unlocked, 6.7\", 50MP Triple Camera, Black", "product_price": "$133.47", "product_original_price": null, "currency": "USD", "product_star_rating": "4.4", "product_num_ratings": 4084, "product_url": "https://www.amazon.com/dp/B0DM1S54MZ", "product_photo": "https://m.media-amazon.com/images/I/61Lp1UcxeLL._AC_UY654_QL65_.jpg", "product_num_offers": 12, "product_minimum_offer_price": "$126.80", "is_best_seller": false, "is_amazon_choice": true, "is_prime": false, "sales_volume": "4K+ bought in past month", "has_variations": true } ] } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data.total_products` | `number` | Total products matching query across all pages | | `data.data.country` | `string` | Country for the listings | | `data.data.domain` | `string` | Amazon domain (e.g. `www.amazon.com`) | | `data.data.products[].asin` | `string` | Amazon Standard Identification Number | | `data.data.products[].product_title` | `string` | Product title | | `data.data.products[].product_price` | `string` | Current price (formatted) | | `data.data.products[].product_original_price` | `string \| null` | Original MSRP if discounted | | `data.data.products[].currency` | `string` | ISO currency code | | `data.data.products[].product_star_rating` | `string` | Average rating (0–5) | | `data.data.products[].product_num_ratings` | `number` | Number of ratings | | `data.data.products[].product_url` | `string` | Amazon product URL | | `data.data.products[].product_photo` | `string` | Primary image URL | | `data.data.products[].product_num_offers` | `number` | Count of third-party offers | | `data.data.products[].is_best_seller` | `boolean` | Carries Best Seller badge | | `data.data.products[].is_amazon_choice` | `boolean` | Carries Amazon's Choice badge | | `data.data.products[].is_prime` | `boolean` | Prime-eligible | | `data.data.products[].sales_volume` | `string \| null` | e.g. `"4K+ bought in past month"` | | `data.data.products[].has_variations` | `boolean` | Has color/size variations | --- ## Seller Reviews *Source: amazon-api/seller-reviews.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/amazon/seller-reviews', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ seller_id: 'A02211013Q5HP3OMSZC7W', page: 1 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/amazon/seller-reviews \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"seller_id": "A02211013Q5HP3OMSZC7W", "page": 1}' ``` ```python import requests res = requests.post( "https://api.yepapi.com/v1/amazon/seller-reviews", headers={"x-api-key": "YOUR_API_KEY"}, json={"seller_id": "A02211013Q5HP3OMSZC7W", "page": 1}, ) print(res.json()["data"]) ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `seller_id` | `string` | Yes | Amazon seller ID | — | | `country` | `string` | No | ISO alpha-2 country code | `US` | | `page` | `number` | No | Page number (5 reviews/page) | `1` | | `star_rating` | `string` | No | `ALL`, `5_STARS`, `4_STARS`, `3_STARS`, `2_STARS`, `1_STARS`, `POSITIVE`, `CRITICAL` | `ALL` | | `verified_purchases_only` | `boolean` | No | Only verified purchasers | `false` | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "request_id": "6c2f60f0-2322-4d79-9b82-a4a87e64b44d", "parameters": { "seller_id": "A02211013Q5HP3OMSZC7W", "country": "US", "page": 1, "star_rating": "ALL" }, "data": { "seller_id": "A02211013Q5HP3OMSZC7W", "country": "US", "domain": "www.amazon.com", "has_next_page": true, "seller_reviews": [ { "review_author": "Vadim p", "review_comment": "I love this product and its smell. But this particular refill is a huge disappointment. The original had strong, lasting smell for weeks. These refills are DOA — all I get is aftersmell.", "review_star_rating": 1, "has_response": false, "review_date": "April 24, 2026" }, { "review_author": "Skye c.", "review_comment": "Came on time and not damaged", "review_star_rating": 5, "has_response": false, "review_date": "April 24, 2026" } ] } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data.seller_id` | `string` | Seller ID | | `data.data.country` | `string` | Country scope | | `data.data.has_next_page` | `boolean` | Whether another page of reviews is available | | `data.data.seller_reviews[].review_author` | `string` | Reviewer display name | | `data.data.seller_reviews[].review_comment` | `string` | Review body text | | `data.data.seller_reviews[].review_star_rating` | `number` | Star rating (1–5) | | `data.data.seller_reviews[].has_response` | `boolean` | Seller has posted a public response | | `data.data.seller_reviews[].review_date` | `string` | Human-readable review date | --- ## Seller Profile *Source: amazon-api/seller.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/amazon/seller', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ seller_id: 'A02211013Q5HP3OMSZC7W' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/amazon/seller \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"seller_id": "A02211013Q5HP3OMSZC7W"}' ``` ```python import requests res = requests.post( "https://api.yepapi.com/v1/amazon/seller", headers={"x-api-key": "YOUR_API_KEY"}, json={"seller_id": "A02211013Q5HP3OMSZC7W"}, ) print(res.json()["data"]) ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `seller_id` | `string` | Yes | Amazon seller ID (e.g. `A02211013Q5HP3OMSZC7W`) | — | | `country` | `string` | No | ISO alpha-2 country code | `US` | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "request_id": "01a5448d-6d26-4beb-a352-ff8eb99205f9", "parameters": { "seller_id": "A02211013Q5HP3OMSZC7W", "country": "US" }, "data": { "seller_id": "A02211013Q5HP3OMSZC7W", "country": "US", "domain": "www.amazon.com", "name": "MemoryWhiz", "seller_link": "https://www.amazon.com/sp?seller=A02211013Q5HP3OMSZC7W", "store_link": "https://www.amazon.com/s?ie=UTF8&marketplaceID=ATVPDKIKX0DER&me=A02211013Q5HP3OMSZC7W", "logo": "https://m.media-amazon.com/images/I/01inXJbpK2L.gif", "phone": "909-610-9170", "business_name": "Alast Corporation", "business_address": "20651 GOLDEN SPRINGS DRIVE Suite 111 Walnut CA 91789 US", "rating": 4.9, "ratings_total": 52177, "ratings_total_percentage": 99, "review_summary": { "thirty_days": { "positive_percent": 94, "neutral_percent": 4, "negative_percent": 2, "count": 45 }, "ninety_days": { "positive_percent": 97, "neutral_percent": 1, "negative_percent": 2, "count": 183 }, "twelve_months": { "positive_percent": 100, "neutral_percent": 0, "negative_percent": 0, "count": 1107 }, "lifetime": { "positive_percent": 99, "neutral_percent": 0, "negative_percent": 0, "count": 52177 } } } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data.seller_id` | `string` | Amazon seller ID | | `data.data.name` | `string` | Storefront display name | | `data.data.seller_link` | `string` | Seller profile URL | | `data.data.store_link` | `string` | Storefront search URL | | `data.data.logo` | `string` | Logo image URL | | `data.data.phone` | `string` | Disclosed phone number | | `data.data.business_name` | `string` | Legal business name | | `data.data.business_address` | `string` | Registered business address | | `data.data.rating` | `number` | Average star rating (0–5) | | `data.data.ratings_total` | `number` | Lifetime ratings count | | `data.data.ratings_total_percentage` | `number` | Positive-percent across lifetime | | `data.data.review_summary.thirty_days` | `object` | `{positive_percent, neutral_percent, negative_percent, count}` | | `data.data.review_summary.ninety_days` | `object` | Same shape, 90-day window | | `data.data.review_summary.twelve_months` | `object` | Same shape, 12-month window | | `data.data.review_summary.lifetime` | `object` | Same shape, all-time | --- ## PDF Generation *Source: dev-utilities/pdf-generation.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tools/pdf/from-html', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ html: '

Invoice #123

Total: $99.00

', }), }); const { data } = await res.json(); console.log(data.url); // CDN URL to the generated PDF ``` ```bash curl -X POST https://api.yepapi.com/v1/tools/pdf/from-html \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"html": "

Invoice #123

Total: $99.00

"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `html` | `string` | Yes | HTML content to convert | — | | `format` | `string` | No | Page size: `a4`, `letter`, `legal` | `"a4"` | | `landscape` | `boolean` | No | Landscape orientation | `false` | | `margin` | `object` | No | Page margins `{top, right, bottom, left}` in px | `{40, 40, 40, 40}` | ### Response **Response:** ```json { "ok": true, "data": { "url": "https://cdn.yepapi.com/pdf/def456.pdf", "pages": 1, "size": 45231, "expiresAt": "2025-04-30T00:00:00Z" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.url` | `string` | CDN URL to the generated PDF file | | `data.pages` | `number` | Total number of pages in the generated PDF | | `data.size` | `number` | File size of the PDF in bytes | | `data.expiresAt` | `string` | ISO 8601 timestamp when the CDN-hosted PDF expires | > Generated PDFs are hosted on our CDN for 30 days. Download them immediately if you need permanent storage. --- ## QR Codes *Source: dev-utilities/qr-codes.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tools/qr', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ data: 'https://yepapi.com', size: 400 }), }); const { data } = await res.json(); console.log(data.url); // CDN URL to the generated QR code ``` ```bash curl -X POST https://api.yepapi.com/v1/tools/qr \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"data": "https://yepapi.com", "size": 400}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `data` | `string` | Yes | Content to encode in the QR code | — | | `size` | `number` | No | Size in pixels | `300` | | `format` | `string` | No | `png` or `svg` | `"png"` | | `color` | `string` | No | Foreground color (hex) | `"#000000"` | | `background` | `string` | No | Background color (hex) | `"#FFFFFF"` | ### Response **Response:** ```json { "ok": true, "data": { "url": "https://cdn.yepapi.com/qr/abc123.png", "format": "png", "size": 400, "expiresAt": "2025-04-30T00:00:00Z" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.url` | `string` | CDN URL to the generated QR code image | | `data.format` | `string` | Image format of the QR code (`png` or `svg`) | | `data.size` | `number` | Size of the generated QR code in pixels | | `data.expiresAt` | `string` | ISO 8601 timestamp when the CDN-hosted image expires | --- ## WHOIS & DNS *Source: dev-utilities/whois-dns.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tools/whois?domain=yepapi.com', { headers: { 'x-api-key': 'YOUR_API_KEY' }, }); const { data } = await res.json(); console.log(data); ``` ```bash curl "https://api.yepapi.com/v1/tools/whois?domain=yepapi.com" \ -H "x-api-key: YOUR_API_KEY" ``` ### Query Parameters | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `domain` | `string` | Yes | Domain to look up | — | | `type` | `string` | No | `whois`, `dns`, or `both` | `"both"` | ### Response **Response:** ```json { "ok": true, "data": { "domain": "yepapi.com", "whois": { "registrar": "Cloudflare, Inc.", "createdAt": "2025-01-15T00:00:00Z", "expiresAt": "2026-01-15T00:00:00Z", "nameServers": ["ns1.cloudflare.com", "ns2.cloudflare.com"] }, "dns": { "a": ["104.21.50.123"], "aaaa": ["2606:4700:3034::6815:327b"], "mx": [{ "priority": 10, "exchange": "mail.yepapi.com" }], "txt": ["v=spf1 include:_spf.google.com ~all"] } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.domain` | `string` | The domain that was looked up | | `data.whois` | `object` | WHOIS registration data for the domain | | `data.whois.registrar` | `string` | Domain registrar name | | `data.whois.createdAt` | `string` | ISO 8601 timestamp when the domain was first registered | | `data.whois.expiresAt` | `string` | ISO 8601 timestamp when the domain registration expires | | `data.whois.nameServers` | `string[]` | Authoritative name servers for the domain | | `data.dns` | `object` | DNS records for the domain | | `data.dns.a` | `string[]` | IPv4 address records | | `data.dns.aaaa` | `string[]` | IPv6 address records | | `data.dns.mx` | `object[]` | Mail exchange records with `priority` and `exchange` fields | | `data.dns.txt` | `string[]` | TXT records (SPF, DKIM, verification, etc.) | --- ## Authentication *Source: getting-started/authentication.mdx* ## API Key Authentication All requests to YepAPI require an API key passed via the `x-api-key` header. ```bash curl https://api.yepapi.com/v1/seo/keywords \ -H "x-api-key: yep_sk_abc123..." ``` ## Getting Your API Key 1. Sign up at [app.yepapi.com](https://app.yepapi.com/signup) 2. You'll receive **$1.00 free balance** immediately 3. Your API key is available on the dashboard API keys follow the format: `yep_sk_` followed by a random string. > Never expose your API key in client-side code. Always make API calls from your server or serverless functions. ## Using with fetch ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/keywords', { method: 'POST', headers: { 'x-api-key': process.env.YEP_API_KEY!, 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords: ['nextjs seo'] }), }); const { ok, data, error } = await res.json(); ``` --- ## Billing *Source: getting-started/billing.mdx* ## How Pricing Works YepAPI uses **pay-per-use pricing** — no subscriptions, no monthly minimums. Add funds to your balance and pay only for the API calls you make. Each endpoint has a fixed cost per call. AI model endpoints are priced based on actual token usage. ## Adding Funds Top up your balance from the [dashboard](/dashboard/billing). Payments are processed via Stripe. Your balance never expires. > Your balance never expires. Add funds once, use them whenever. ## Endpoint Pricing ### SEO & Keywords | Endpoint | Cost | | :------- | :--- | | `/v1/seo/keywords` | $0.11 | | `/v1/seo/keywords/ideas` | $0.02 | | `/v1/seo/keywords/related` | $0.02 | | `/v1/serp` | $0.01 | | `/v1/serp/competitors` | $0.01 | | `/v1/seo/domain/overview` | $0.01 | | `/v1/seo/domain/keywords` | $0.03 | | `/v1/seo/domain/backlinks` | $0.03 | ### AI Visibility | Endpoint | Cost | | :------- | :--- | | `/v1/seo/ai-visibility` | $0.25 | | `/v1/seo/ai-visibility/prompts` | $0.10 | ### Web Scraping | Endpoint | Cost | | :------- | :--- | | `/v1/scrape` | $0.01 | | `/v1/scrape/stealth` | $0.03 | | `/v1/scrape/ai-extract` | $0.03 | ### Dev Utilities | Endpoint | Cost | | :------- | :--- | | `/v1/tools/qr` | $0.01 | | `/v1/tools/pdf/from-html` | $0.01 | | `/v1/tools/whois` | $0.01 | ### AI Models AI model endpoints are priced based on actual token usage (input + output tokens). The minimum charge is **$0.01** per request. | Endpoint | Pricing | | :------- | :------ | | `/v1/ai/chat` | Usage-based (per token) | | `/v1/ai/chat/completions` | Usage-based (per token) | See individual [model pages](/ai-models) for per-token pricing details. ## Auto-Topup Enable auto-topup in your dashboard to never run out of funds. When your balance drops below a threshold, we automatically top up your selected amount. ## Checking Your Balance ```bash curl https://api.yepapi.com/v1/account/balance \ -H "x-api-key: YOUR_API_KEY" ``` ```json { "ok": true, "data": { "balanceCents": 1247, "balanceUsd": 12.47, "autoTopup": true } } ``` --- ## Errors *Source: getting-started/errors.mdx* ## Error Format All errors follow the same format: ```json { "ok": false, "error": { "code": "ERROR_CODE", "message": "Human-readable description" } } ``` ## Error Codes | Code | HTTP Status | Description | | :--- | :---------- | :---------- | | `INVALID_API_KEY` | 401 | Missing or invalid API key | | `REVOKED_API_KEY` | 401 | API key has been revoked | | `NO_CREDITS` | 402 | Insufficient balance for this request | | `VALIDATION_ERROR` | 400 | Request body validation failed | | `NOT_FOUND` | 404 | Endpoint or resource not found | | `JOB_NOT_FOUND` | 404 | Media job not found | | `JOB_EXPIRED` | 410 | Job result has expired, resubmit your request | | `MEDIA_MODEL_NOT_FOUND` | 400 | Unknown media model ID | | `UPSTREAM_ERROR` | 502 | Upstream provider returned an error | | `AI_UPSTREAM_ERROR` | 502 | AI provider returned an error | | `INTERNAL_ERROR` | 500 | Something went wrong on our end | ## Handling Errors ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/keywords', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords: ['nextjs seo'] }), }); const result = await res.json(); if (!result.ok) { const { code, message } = result.error; if (code === 'NO_CREDITS') { // Add funds at https://yepapi.com/dashboard/billing } } ``` ## Upstream Errors When an upstream data source returns an error, we return an `UPSTREAM_ERROR` with additional context: ```json { "ok": false, "error": { "code": "UPSTREAM_ERROR", "message": "Upstream data source returned an error", "upstream": { "status": 500, "message": "Internal server error" } } } ``` --- ## Introduction *Source: getting-started/introduction.mdx* ## What is YepAPI? YepAPI is a **unified API for builders** that wraps the best data sources behind a single API key, a single response format, and simple pay-as-you-go pricing. **One API key. 40+ endpoints. Zero subscriptions.** ## The Problem Building anything useful today means juggling 5+ API subscriptions: - **SEO data?** One provider wants $50/mo minimum, snake_case responses, and location ID lookups - **Scraping?** Another charges $49/mo with proxy config headaches - **AI Visibility?** Separate contract, XML responses - **QR codes, PDFs?** Yet another service Each provider has different auth methods, response formats, error codes, and billing models. By the time you wire them together, you've burned a week. ## The YepAPI Way Every response follows the same shape: ```json { "ok": true, "data": { ... } } ``` Or on error: ```json { "ok": false, "error": { "code": "INVALID_PARAMS", "message": "keywords array is required" } } ``` No XML. No `snake_case`. No surprise fields. Just `camelCase` JSON, every time. ## Key Principles - **Pay-as-you-go** — Add funds, use them whenever. No monthly minimums. - **camelCase everything** — We normalize all upstream responses to consistent camelCase. - **Transparent pricing** — Every endpoint shows its cost in USD upfront. - **AI-native** — Built for Cursor, Claude, and AI agents from day one. MCP server included. ## Quick Start ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/keywords', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords: ['nextjs seo'] }), }); const { ok, data } = await res.json(); console.log(data); ``` Or with cURL: ```bash curl -X POST https://api.yepapi.com/v1/seo/keywords \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keywords": ["nextjs seo"]}' ``` --- ## YepAPI Documentation *Source: index.mdx* Welcome to the YepAPI documentation. Get started with the guides below. ## Quick Links - [Introduction](/getting-started/introduction) — What is YepAPI and why it exists - [Authentication](/getting-started/authentication) — Set up your API key - [Billing](/getting-started/billing) — Pay-per-use pricing ## API Reference - [Keyword Research](/seo-keywords/keywords) — Search volume, CPC, difficulty - [SERP Analysis](/seo-keywords/serp) — Analyze search results - [Web Scraping](/web-scraping/standard-scrape) — Scrape any URL to markdown - [AI Visibility](/ai-visibility/brand-visibility) — Track your brand across AI engines ## For AI Agents - [MCP Server](/ai-agents/mcp-server) — Use YepAPI from Claude Desktop - [Cursor & Claude](/ai-agents/cursor-claude) — AI coding assistant setup - [`/llms.txt`](/llms.txt) — Machine-readable API reference - [`/openapi.json`](/openapi.json) — OpenAPI 3.1 specification --- ## Hashtag Search *Source: instagram-api/hashtag.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/hashtag', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ hashtag: 'travelphotography' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/hashtag \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"hashtag": "travelphotography"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `hashtag` | `string` | Yes | Hashtag name (without #) | — | ### Response **Response:** ```json { "ok": true, "data": { "name": "travelphotography", "media_count": 189000000, "top_posts": [ { "id": "3456789012345678901", "shortcode": "C5xAbCdEfGh", "type": "GraphImage", "caption": "Sunset in Santorini #travelphotography", "like_count": 890000, "comment_count": 4500, "taken_at": 1712345678, "display_url": "https://scontent.cdninstagram.com/...", "is_video": false, "owner": { "username": "travel_photographer", "profile_pic_url": "https://scontent.cdninstagram.com/..." } } ], "recent_posts": [ { "id": "3456789012345678902", "shortcode": "C5yBcDeFgHi", "type": "GraphImage", "like_count": 1200, "comment_count": 45, "taken_at": 1712678901, "display_url": "https://scontent.cdninstagram.com/...", "is_video": false } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.name` | `string` | Hashtag name | | `data.media_count` | `number` | Total number of posts using this hashtag | | `data.top_posts` | `object[]` | Array of top/featured posts for this hashtag | | `data.top_posts[].id` | `string` | Unique post identifier | | `data.top_posts[].shortcode` | `string` | Post shortcode (used in URLs) | | `data.top_posts[].type` | `string` | Post type: `GraphImage`, `GraphVideo`, or `GraphSidecar` | | `data.top_posts[].caption` | `string` | Post caption text | | `data.top_posts[].like_count` | `number` | Number of likes | | `data.top_posts[].comment_count` | `number` | Number of comments | | `data.top_posts[].taken_at` | `number` | Unix timestamp of when the post was published | | `data.top_posts[].display_url` | `string` | Full-size image URL | | `data.top_posts[].owner` | `object` | Post author information | | `data.recent_posts` | `object[]` | Array of recent posts using this hashtag | --- ## Media ID Lookup *Source: instagram-api/media-id.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/media-id', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ shortcode: 'C5xAbCdEfGh' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/media-id \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"shortcode": "C5xAbCdEfGh"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `shortcode` | `string` | Yes | Post shortcode from the Instagram URL | — | ### Response **Response:** ```json { "ok": true, "data": { "shortcode": "C5xAbCdEfGh", "media_id": "3456789012345678901", "media_id_with_owner": "3456789012345678901_787132" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.shortcode` | `string` | The input shortcode | | `data.media_id` | `string` | Numeric media ID | | `data.media_id_with_owner` | `string` | Media ID with owner ID suffix (format: `{media_id}_{owner_id}`) | The shortcode is the unique identifier found in Instagram post URLs: `https://www.instagram.com/p/{shortcode}/`. This endpoint is useful when you need the numeric media ID for other API calls or integrations. --- ## Post Comments *Source: instagram-api/post-comments.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/post-comments', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ shortcode: 'C5xAbCdEfGh' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/post-comments \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"shortcode": "C5xAbCdEfGh"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `shortcode` | `string` | Yes | Post shortcode from the Instagram URL | — | | `end_cursor` | `string` | No | Pagination cursor from previous response | — | ### Response **Response:** ```json { "ok": true, "data": { "has_next_page": true, "end_cursor": "QVFDcE...", "comment_count": 1200, "comments": [ { "id": "17891234567890123", "text": "Absolutely breathtaking!", "created_at": 1712346000, "like_count": 4500, "reply_count": 12, "owner": { "username": "photo_fan", "profile_pic_url": "https://scontent.cdninstagram.com/...", "is_verified": false } }, { "id": "17891234567890124", "text": "Where was this taken?", "created_at": 1712347000, "like_count": 230, "reply_count": 3, "owner": { "username": "traveler_mike", "profile_pic_url": "https://scontent.cdninstagram.com/...", "is_verified": false } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_next_page` | `boolean` | Whether more comments are available | | `data.end_cursor` | `string` | Cursor for fetching the next page | | `data.comment_count` | `number` | Total number of comments on the post | | `data.comments` | `object[]` | Array of comment objects | | `data.comments[].id` | `string` | Unique comment identifier | | `data.comments[].text` | `string` | Comment text | | `data.comments[].created_at` | `number` | Unix timestamp of when the comment was posted | | `data.comments[].like_count` | `number` | Number of likes on the comment | | `data.comments[].reply_count` | `number` | Number of replies to this comment | | `data.comments[].owner` | `object` | Comment author information | Use the `end_cursor` value from the response to paginate through comments. --- ## Post Likers *Source: instagram-api/post-likers.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/post-likers', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ shortcode: 'C5xAbCdEfGh' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/post-likers \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"shortcode": "C5xAbCdEfGh"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `shortcode` | `string` | Yes | Post shortcode from the Instagram URL | — | | `end_cursor` | `string` | No | Pagination cursor from previous response | — | ### Response **Response:** ```json { "ok": true, "data": { "has_next_page": true, "end_cursor": "QVFDcE...", "likers": [ { "id": "12345678901", "username": "photo_fan", "full_name": "Photo Fan", "profile_pic_url": "https://scontent.cdninstagram.com/...", "is_verified": false, "is_private": false } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_next_page` | `boolean` | Whether more likers are available | | `data.end_cursor` | `string` | Cursor for fetching the next page | | `data.likers` | `object[]` | Array of user objects who liked the post | | `data.likers[].id` | `string` | Unique user identifier | | `data.likers[].username` | `string` | Instagram username | | `data.likers[].full_name` | `string` | User's display name | | `data.likers[].profile_pic_url` | `string` | Profile picture URL | | `data.likers[].is_verified` | `boolean` | Whether the user is verified | | `data.likers[].is_private` | `boolean` | Whether the account is private | Use the `end_cursor` value from the response to paginate through likers. --- ## Post Details *Source: instagram-api/post.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/post', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ shortcode: 'C5xAbCdEfGh' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/post \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"shortcode": "C5xAbCdEfGh"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `shortcode` | `string` | Yes | Post shortcode from the Instagram URL | — | ### Response **Response:** ```json { "ok": true, "data": { "id": "3456789012345678901", "shortcode": "C5xAbCdEfGh", "type": "GraphImage", "caption": "A stunning sunset over the Sahara Desert. Photo by @photographer_name", "like_count": 450000, "comment_count": 1200, "taken_at": 1712345678, "display_url": "https://scontent.cdninstagram.com/...", "is_video": false, "video_url": null, "video_view_count": null, "video_duration": null, "owner": { "id": "787132", "username": "natgeo", "full_name": "National Geographic", "profile_pic_url": "https://scontent.cdninstagram.com/...", "is_verified": true }, "location": { "name": "Sahara Desert", "lat": 23.4162, "lng": 25.6628 }, "tagged_users": [ { "username": "photographer_name", "full_name": "John Photographer" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.id` | `string` | Unique post identifier | | `data.shortcode` | `string` | Post shortcode | | `data.type` | `string` | Post type: `GraphImage`, `GraphVideo`, or `GraphSidecar` | | `data.caption` | `string` | Post caption text | | `data.like_count` | `number` | Number of likes | | `data.comment_count` | `number` | Number of comments | | `data.taken_at` | `number` | Unix timestamp of when the post was published | | `data.display_url` | `string` | Full-size image URL | | `data.is_video` | `boolean` | Whether the post is a video | | `data.video_url` | `string\|null` | Video URL (null for images) | | `data.video_view_count` | `number\|null` | Video view count (null for images) | | `data.owner` | `object` | Post author information | | `data.location` | `object\|null` | Tagged location (if any) | | `data.tagged_users` | `object[]` | Users tagged in the post | The shortcode is the unique identifier found in Instagram post URLs: `https://www.instagram.com/p/{shortcode}/` --- ## Instagram Search *Source: instagram-api/search.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/search', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'travel photography' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/search \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "travel photography"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query | — | ### Response **Response:** ```json { "ok": true, "data": { "users": [ { "username": "travelphotography", "full_name": "Travel Photography", "profile_pic_url": "https://scontent.cdninstagram.com/...", "is_verified": true, "follower_count": 5200000, "is_private": false } ], "hashtags": [ { "name": "travelphotography", "media_count": 189000000 } ], "places": [ { "title": "Travel Photography Studio", "location": { "lat": 40.7128, "lng": -74.006 } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.users` | `object[]` | Array of matching user accounts | | `data.users[].username` | `string` | Instagram username | | `data.users[].full_name` | `string` | User's display name | | `data.users[].profile_pic_url` | `string` | Profile picture URL | | `data.users[].is_verified` | `boolean` | Whether the user is verified | | `data.users[].follower_count` | `number` | Number of followers | | `data.users[].is_private` | `boolean` | Whether the account is private | | `data.hashtags` | `object[]` | Array of matching hashtags | | `data.hashtags[].name` | `string` | Hashtag name (without #) | | `data.hashtags[].media_count` | `number` | Number of posts using this hashtag | | `data.places` | `object[]` | Array of matching places | --- ## User About *Source: instagram-api/user-about.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/user-about', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ username: 'natgeo' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/user-about \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"username": "natgeo"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `username` | `string` | Yes | Instagram username | — | ### Response **Response:** ```json { "ok": true, "data": { "username": "natgeo", "full_name": "National Geographic", "biography": "Experience the world through the eyes of National Geographic photographers.", "date_joined": "2012-05-15", "account_type": "Business", "category": "Media/News Company", "country": "United States", "former_usernames": [], "ads_count": 12 } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.username` | `string` | Instagram username | | `data.full_name` | `string` | User's display name | | `data.biography` | `string` | User bio text | | `data.date_joined` | `string` | Date the account was created | | `data.account_type` | `string` | Account type (Personal, Business, Creator) | | `data.category` | `string` | Business or creator category | | `data.country` | `string` | Country associated with the account | | `data.former_usernames` | `string[]` | Previous usernames used by this account | | `data.ads_count` | `number` | Number of active ads run by this account | --- ## User Followers *Source: instagram-api/user-followers.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/user-followers', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ username: 'natgeo' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/user-followers \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"username": "natgeo"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `username` | `string` | Yes | Instagram username | — | | `end_cursor` | `string` | No | Pagination cursor from previous response | — | ### Response **Response:** ```json { "ok": true, "data": { "has_next_page": true, "end_cursor": "QVFDcE...", "followers": [ { "id": "12345678901", "username": "photo_enthusiast", "full_name": "Photo Enthusiast", "profile_pic_url": "https://scontent.cdninstagram.com/...", "is_verified": false, "is_private": false } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_next_page` | `boolean` | Whether more followers are available | | `data.end_cursor` | `string` | Cursor for fetching the next page | | `data.followers` | `object[]` | Array of follower user objects | | `data.followers[].id` | `string` | Unique user identifier | | `data.followers[].username` | `string` | Instagram username | | `data.followers[].full_name` | `string` | User's display name | | `data.followers[].profile_pic_url` | `string` | Profile picture URL | | `data.followers[].is_verified` | `boolean` | Whether the user is verified | | `data.followers[].is_private` | `boolean` | Whether the account is private | Use the `end_cursor` value from the response to paginate through followers. --- ## User Highlights *Source: instagram-api/user-highlights.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/user-highlights', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ username: 'natgeo' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/user-highlights \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"username": "natgeo"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `username` | `string` | Yes | Instagram username | — | ### Response **Response:** ```json { "ok": true, "data": { "username": "natgeo", "highlights": [ { "id": "17891234567890123", "title": "Wildlife", "cover_media_url": "https://scontent.cdninstagram.com/...", "item_count": 24, "items": [ { "id": "3456789012345678901", "taken_at": 1712345678, "is_video": false, "display_url": "https://scontent.cdninstagram.com/...", "video_url": null } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.username` | `string` | Instagram username | | `data.highlights` | `object[]` | Array of highlight collections | | `data.highlights[].id` | `string` | Unique highlight identifier | | `data.highlights[].title` | `string` | Highlight title | | `data.highlights[].cover_media_url` | `string` | Highlight cover image URL | | `data.highlights[].item_count` | `number` | Number of items in the highlight | | `data.highlights[].items` | `object[]` | Array of story items in the highlight | | `data.highlights[].items[].id` | `string` | Unique item identifier | | `data.highlights[].items[].taken_at` | `number` | Unix timestamp of when the item was posted | | `data.highlights[].items[].is_video` | `boolean` | Whether the item is a video | | `data.highlights[].items[].display_url` | `string` | Image URL | | `data.highlights[].items[].video_url` | `string\|null` | Video URL (null for images) | --- ## User Posts *Source: instagram-api/user-posts.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/user-posts', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ username: 'natgeo' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/user-posts \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"username": "natgeo"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `username` | `string` | Yes | Instagram username | — | | `end_cursor` | `string` | No | Pagination cursor from previous response | — | ### Response **Response:** ```json { "ok": true, "data": { "has_next_page": true, "end_cursor": "QVFDcE...", "posts": [ { "id": "3456789012345678901", "shortcode": "C5xAbCdEfGh", "type": "GraphImage", "caption": "A stunning sunset over the Sahara Desert. Photo by @photographer_name", "like_count": 450000, "comment_count": 1200, "taken_at": 1712345678, "display_url": "https://scontent.cdninstagram.com/...", "thumbnail_url": "https://scontent.cdninstagram.com/...", "is_video": false, "video_view_count": null, "accessibility_caption": "Photo of desert landscape at sunset" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_next_page` | `boolean` | Whether more posts are available | | `data.end_cursor` | `string` | Cursor for fetching the next page | | `data.posts` | `object[]` | Array of post objects | | `data.posts[].id` | `string` | Unique post identifier | | `data.posts[].shortcode` | `string` | Post shortcode (used in URLs) | | `data.posts[].type` | `string` | Post type: `GraphImage`, `GraphVideo`, or `GraphSidecar` | | `data.posts[].caption` | `string` | Post caption text | | `data.posts[].like_count` | `number` | Number of likes | | `data.posts[].comment_count` | `number` | Number of comments | | `data.posts[].taken_at` | `number` | Unix timestamp of when the post was published | | `data.posts[].display_url` | `string` | Full-size image URL | | `data.posts[].is_video` | `boolean` | Whether the post is a video | | `data.posts[].video_view_count` | `number\|null` | Video view count (null for images) | Use the `end_cursor` value from the response as the `end_cursor` parameter to fetch the next page of posts. --- ## User Reels *Source: instagram-api/user-reels.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/user-reels', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ username: 'natgeo' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/user-reels \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"username": "natgeo"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `username` | `string` | Yes | Instagram username | — | | `end_cursor` | `string` | No | Pagination cursor from previous response | — | ### Response **Response:** ```json { "ok": true, "data": { "has_next_page": true, "end_cursor": "QVFDcE...", "reels": [ { "id": "3456789012345678901", "shortcode": "C5xAbCdEfGh", "caption": "Watch this incredible migration in the Serengeti", "like_count": 890000, "comment_count": 3400, "play_count": 12000000, "taken_at": 1712345678, "video_duration": 30.5, "display_url": "https://scontent.cdninstagram.com/...", "video_url": "https://scontent.cdninstagram.com/..." } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_next_page` | `boolean` | Whether more reels are available | | `data.end_cursor` | `string` | Cursor for fetching the next page | | `data.reels` | `object[]` | Array of reel objects | | `data.reels[].id` | `string` | Unique reel identifier | | `data.reels[].shortcode` | `string` | Reel shortcode (used in URLs) | | `data.reels[].caption` | `string` | Reel caption text | | `data.reels[].like_count` | `number` | Number of likes | | `data.reels[].comment_count` | `number` | Number of comments | | `data.reels[].play_count` | `number` | Number of plays/views | | `data.reels[].taken_at` | `number` | Unix timestamp of when the reel was published | | `data.reels[].video_duration` | `number` | Video duration in seconds | | `data.reels[].display_url` | `string` | Cover image URL | | `data.reels[].video_url` | `string` | Video playback URL | Use the `end_cursor` value from the response to paginate through reels. --- ## Similar Accounts *Source: instagram-api/user-similar.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/user-similar', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ username: 'natgeo' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/user-similar \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"username": "natgeo"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `username` | `string` | Yes | Instagram username | — | ### Response **Response:** ```json { "ok": true, "data": { "similar_accounts": [ { "username": "discoverearth", "full_name": "Discover Earth", "profile_pic_url": "https://scontent.cdninstagram.com/...", "is_verified": true, "follower_count": 12500000 }, { "username": "earthpix", "full_name": "EarthPix", "profile_pic_url": "https://scontent.cdninstagram.com/...", "is_verified": true, "follower_count": 8900000 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.similar_accounts` | `object[]` | Array of similar account objects | | `data.similar_accounts[].username` | `string` | Instagram username | | `data.similar_accounts[].full_name` | `string` | User's display name | | `data.similar_accounts[].profile_pic_url` | `string` | Profile picture URL | | `data.similar_accounts[].is_verified` | `boolean` | Whether the user is verified | | `data.similar_accounts[].follower_count` | `number` | Number of followers | --- ## User Stories *Source: instagram-api/user-stories.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/user-stories', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ username: 'natgeo' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/user-stories \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"username": "natgeo"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `username` | `string` | Yes | Instagram username | — | ### Response **Response:** ```json { "ok": true, "data": { "username": "natgeo", "stories": [ { "id": "3456789012345678901", "taken_at": 1712345678, "expiring_at": 1712432078, "is_video": false, "display_url": "https://scontent.cdninstagram.com/...", "video_url": null, "video_duration": null }, { "id": "3456789012345678902", "taken_at": 1712350000, "expiring_at": 1712436400, "is_video": true, "display_url": "https://scontent.cdninstagram.com/...", "video_url": "https://scontent.cdninstagram.com/...", "video_duration": 12.3 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.username` | `string` | Instagram username | | `data.stories` | `object[]` | Array of active story items | | `data.stories[].id` | `string` | Unique story item identifier | | `data.stories[].taken_at` | `number` | Unix timestamp of when the story was posted | | `data.stories[].expiring_at` | `number` | Unix timestamp of when the story expires | | `data.stories[].is_video` | `boolean` | Whether the story item is a video | | `data.stories[].display_url` | `string` | Image URL (or video cover for video stories) | | `data.stories[].video_url` | `string\|null` | Video URL (null for image stories) | | `data.stories[].video_duration` | `number\|null` | Video duration in seconds (null for image stories) | Stories are ephemeral and typically expire after 24 hours. --- ## User Tagged Posts *Source: instagram-api/user-tagged.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/user-tagged', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ username: 'natgeo' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/user-tagged \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"username": "natgeo"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `username` | `string` | Yes | Instagram username | — | | `end_cursor` | `string` | No | Pagination cursor from previous response | — | ### Response **Response:** ```json { "ok": true, "data": { "has_next_page": true, "end_cursor": "QVFDcE...", "posts": [ { "id": "3456789012345678901", "shortcode": "C5xAbCdEfGh", "type": "GraphImage", "caption": "Amazing shot featured by @natgeo", "like_count": 125000, "comment_count": 340, "taken_at": 1712345678, "display_url": "https://scontent.cdninstagram.com/...", "owner": { "username": "photographer_name", "profile_pic_url": "https://scontent.cdninstagram.com/..." } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_next_page` | `boolean` | Whether more posts are available | | `data.end_cursor` | `string` | Cursor for fetching the next page | | `data.posts` | `object[]` | Array of tagged post objects | | `data.posts[].id` | `string` | Unique post identifier | | `data.posts[].shortcode` | `string` | Post shortcode (used in URLs) | | `data.posts[].type` | `string` | Post type: `GraphImage`, `GraphVideo`, or `GraphSidecar` | | `data.posts[].caption` | `string` | Post caption text | | `data.posts[].like_count` | `number` | Number of likes | | `data.posts[].comment_count` | `number` | Number of comments | | `data.posts[].taken_at` | `number` | Unix timestamp of when the post was published | | `data.posts[].display_url` | `string` | Full-size image URL | | `data.posts[].owner` | `object` | Post author information | Use the `end_cursor` value from the response to paginate through tagged posts. --- ## User Profile *Source: instagram-api/user.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/instagram/user', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ username: 'natgeo' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/instagram/user \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"username": "natgeo"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `username` | `string` | Yes | Instagram username | — | ### Response **Response:** ```json { "ok": true, "data": { "id": "787132", "username": "natgeo", "full_name": "National Geographic", "biography": "Experience the world through the eyes of National Geographic photographers.", "profile_pic_url": "https://scontent.cdninstagram.com/...", "profile_pic_url_hd": "https://scontent.cdninstagram.com/...", "follower_count": 284000000, "following_count": 156, "media_count": 28500, "is_verified": true, "is_private": false, "is_business_account": true, "category": "Media/News Company", "external_url": "https://www.nationalgeographic.com" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.id` | `string` | Unique Instagram user ID | | `data.username` | `string` | Instagram username | | `data.full_name` | `string` | User's display name | | `data.biography` | `string` | User bio text | | `data.profile_pic_url` | `string` | Standard profile picture URL | | `data.profile_pic_url_hd` | `string` | High-resolution profile picture URL | | `data.follower_count` | `number` | Number of followers | | `data.following_count` | `number` | Number of accounts followed | | `data.media_count` | `number` | Total number of posts | | `data.is_verified` | `boolean` | Whether the user is verified | | `data.is_private` | `boolean` | Whether the account is private | | `data.is_business_account` | `boolean` | Whether this is a business account | | `data.category` | `string` | Business category (if applicable) | | `data.external_url` | `string` | Link in bio URL | --- ## Location Codes *Source: reference/location-codes.mdx* ## Overview All SEO API endpoints accept a `location_code` parameter to target search results for a specific country. Pass the integer code from the table below. ```json { "keywords": ["react framework"], "location_code": 2840, "language": "en" } ``` > If you omit `location_code`, the API defaults to **2840** (United States). You can also pass a `location` string (e.g. `"us"`) as a fallback, but `location_code` is recommended for precision and full coverage. ## Supported Location Codes | Country | ISO Code | Location Code | | :--- | :---: | :---: | | Afghanistan | AF | `2004` | | Albania | AL | `2008` | | Algeria | DZ | `2012` | | American Samoa | AS | `2016` | | Andorra | AD | `2020` | | Angola | AO | `2024` | | Antarctica | AQ | `2010` | | Antigua and Barbuda | AG | `2028` | | Argentina | AR | `2032` | | Armenia | AM | `2051` | | Australia | AU | `2036` | | Austria | AT | `2040` | | Azerbaijan | AZ | `2031` | | Bahrain | BH | `2048` | | Bangladesh | BD | `2050` | | Barbados | BB | `2052` | | Belgium | BE | `2056` | | Belize | BZ | `2084` | | Benin | BJ | `2204` | | Bhutan | BT | `2064` | | Bolivia | BO | `2068` | | Bosnia and Herzegovina | BA | `2070` | | Botswana | BW | `2072` | | Brazil | BR | `2076` | | Brunei | BN | `2096` | | Bulgaria | BG | `2100` | | Burkina Faso | BF | `2854` | | Burundi | BI | `2108` | | Cabo Verde | CV | `2132` | | Cambodia | KH | `2116` | | Cameroon | CM | `2120` | | Canada | CA | `2124` | | Caribbean Netherlands | BQ | `2535` | | Central African Republic | CF | `2140` | | Chad | TD | `2148` | | Chile | CL | `2152` | | China | CN | `2156` | | Christmas Island | CX | `2162` | | Cocos (Keeling) Islands | CC | `2166` | | Colombia | CO | `2170` | | Comoros | KM | `2174` | | Cook Islands | CK | `2184` | | Costa Rica | CR | `2188` | | Cote d'Ivoire | CI | `2384` | | Croatia | HR | `2191` | | Curacao | CW | `2531` | | Cyprus | CY | `2196` | | Czechia | CZ | `2203` | | Democratic Republic of the Congo | CD | `2180` | | Denmark | DK | `2208` | | Djibouti | DJ | `2262` | | Dominica | DM | `2212` | | Dominican Republic | DO | `2214` | | Ecuador | EC | `2218` | | Egypt | EG | `2818` | | El Salvador | SV | `2222` | | Equatorial Guinea | GQ | `2226` | | Eritrea | ER | `2232` | | Estonia | EE | `2233` | | Eswatini | SZ | `2748` | | Ethiopia | ET | `2231` | | Fiji | FJ | `2242` | | Finland | FI | `2246` | | France | FR | `2250` | | French Polynesia | PF | `2258` | | French Southern and Antarctic Lands | TF | `2260` | | Gabon | GA | `2266` | | Georgia | GE | `2268` | | Germany | DE | `2276` | | Ghana | GH | `2288` | | Greece | GR | `2300` | | Grenada | GD | `2308` | | Guam | GU | `2316` | | Guatemala | GT | `2320` | | Guernsey | GG | `2831` | | Guinea | GN | `2324` | | Guinea-Bissau | GW | `2624` | | Guyana | GY | `2328` | | Haiti | HT | `2332` | | Heard Island and McDonald Islands | HM | `2334` | | Honduras | HN | `2340` | | Hong Kong | HK | `2344` | | Hungary | HU | `2348` | | Iceland | IS | `2352` | | India | IN | `2356` | | Indonesia | ID | `2360` | | Iraq | IQ | `2368` | | Ireland | IE | `2372` | | Isle of Man | IM | `2833` | | Israel | IL | `2376` | | Italy | IT | `2380` | | Jamaica | JM | `2388` | | Japan | JP | `2392` | | Jersey | JE | `2832` | | Jordan | JO | `2400` | | Kazakhstan | KZ | `2398` | | Kenya | KE | `2404` | | Kiribati | KI | `2296` | | Kuwait | KW | `2414` | | Kyrgyzstan | KG | `2417` | | Laos | LA | `2418` | | Latvia | LV | `2428` | | Lebanon | LB | `2422` | | Lesotho | LS | `2426` | | Liberia | LR | `2430` | | Libya | LY | `2434` | | Liechtenstein | LI | `2438` | | Lithuania | LT | `2440` | | Luxembourg | LU | `2442` | | Madagascar | MG | `2450` | | Malawi | MW | `2454` | | Malaysia | MY | `2458` | | Maldives | MV | `2462` | | Mali | ML | `2466` | | Malta | MT | `2470` | | Marshall Islands | MH | `2584` | | Mauritania | MR | `2478` | | Mauritius | MU | `2480` | | Mexico | MX | `2484` | | Micronesia | FM | `2583` | | Moldova | MD | `2498` | | Monaco | MC | `2492` | | Mongolia | MN | `2496` | | Montenegro | ME | `2499` | | Morocco | MA | `2504` | | Mozambique | MZ | `2508` | | Myanmar (Burma) | MM | `2104` | | Namibia | NA | `2516` | | Nauru | NR | `2520` | | Nepal | NP | `2524` | | Netherlands | NL | `2528` | | New Caledonia | NC | `2540` | | New Zealand | NZ | `2554` | | Nicaragua | NI | `2558` | | Niger | NE | `2562` | | Nigeria | NG | `2566` | | Niue | NU | `2570` | | Norfolk Island | NF | `2574` | | North Macedonia | MK | `2807` | | Northern Mariana Islands | MP | `2580` | | Norway | NO | `2578` | | Oman | OM | `2512` | | Pakistan | PK | `2586` | | Palau | PW | `2585` | | Panama | PA | `2591` | | Papua New Guinea | PG | `2598` | | Paraguay | PY | `2600` | | Peru | PE | `2604` | | Philippines | PH | `2608` | | Pitcairn Islands | PN | `2612` | | Poland | PL | `2616` | | Portugal | PT | `2620` | | Qatar | QA | `2634` | | Republic of the Congo | CG | `2178` | | Romania | RO | `2642` | | Rwanda | RW | `2646` | | Saint Helena, Ascension and Tristan da Cunha | SH | `2654` | | Saint Kitts and Nevis | KN | `2659` | | Saint Lucia | LC | `2662` | | Saint Martin | MF | `2663` | | Saint Pierre and Miquelon | PM | `2666` | | Saint Vincent and the Grenadines | VC | `2670` | | Samoa | WS | `2882` | | San Marino | SM | `2674` | | Sao Tome and Principe | ST | `2678` | | Saudi Arabia | SA | `2682` | | Senegal | SN | `2686` | | Serbia | RS | `2688` | | Seychelles | SC | `2690` | | Sierra Leone | SL | `2694` | | Singapore | SG | `2702` | | Sint Maarten | SX | `2534` | | Slovakia | SK | `2703` | | Slovenia | SI | `2705` | | Solomon Islands | SB | `2090` | | Somalia | SO | `2706` | | South Africa | ZA | `2710` | | South Georgia and the South Sandwich Islands | GS | `2239` | | South Korea | KR | `2410` | | Spain | ES | `2724` | | Sri Lanka | LK | `2144` | | Suriname | SR | `2740` | | Sweden | SE | `2752` | | Switzerland | CH | `2756` | | Taiwan | TW | `2158` | | Tajikistan | TJ | `2762` | | Tanzania | TZ | `2834` | | Thailand | TH | `2764` | | The Bahamas | BS | `2044` | | The Gambia | GM | `2270` | | Timor-Leste | TL | `2626` | | Togo | TG | `2768` | | Tokelau | TK | `2772` | | Tonga | TO | `2776` | | Trinidad and Tobago | TT | `2780` | | Tunisia | TN | `2788` | | Turkiye | TR | `2792` | | Turkmenistan | TM | `2795` | | Tuvalu | TV | `2798` | | Uganda | UG | `2800` | | Ukraine | UA | `2804` | | United Arab Emirates | AE | `2784` | | United Kingdom | GB | `2826` | | United States | US | `2840` | | United States Minor Outlying Islands | UM | `2581` | | Uruguay | UY | `2858` | | Uzbekistan | UZ | `2860` | | Vanuatu | VU | `2548` | | Vatican City | VA | `2336` | | Venezuela | VE | `2862` | | Vietnam | VN | `2704` | | Wallis and Futuna | WF | `2876` | | Yemen | YE | `2887` | | Zambia | ZM | `2894` | | Zimbabwe | ZW | `2716` | ## Endpoints That Use Location Codes All of the following endpoints accept `location_code`: - **[Keyword Research](/seo-keywords/keywords)** — `/v1/seo/keywords` - **[Keyword Ideas](/seo-keywords/keywords-ideas)** — `/v1/seo/keywords/ideas` - **[Related Keywords](/seo-keywords/keywords-related)** — `/v1/seo/keywords/related` - **[SERP Analysis](/seo-keywords/serp)** — `/v1/serp` - **[Domain Overview](/seo-domain/domain-overview)** — `/v1/seo/domain/overview` - **[Domain Keywords](/seo-domain/domain-keywords)** — `/v1/seo/domain/keywords` --- ## ChatGPT Scraper *Source: seo-ai-optimization/chatgpt.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/ai/chatgpt', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keyword: 'best website hosting platforms', location: 'us' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/ai/chatgpt \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keyword": "best website hosting platforms", "location": "us"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keyword` | `string` | Yes | Query to send to ChatGPT | — | | `location` | `string` | No | Country code | `"us"` | ### Response **Response:** ```json { "ok": true, "data": { "keyword": "best website hosting platforms", "response": "Based on current market analysis, the top website hosting platforms include Vercel for frontend deployments, AWS for enterprise infrastructure...", "references": [ { "url": "https://www.g2.com/categories/web-hosting", "title": "Best Web Hosting Services 2026", "snippet": "Compare the top web hosting..." }, { "url": "https://www.techradar.com/hosting", "title": "Best Web Hosting 2026", "snippet": "We tested and reviewed..." } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.keyword` | `string` | The query that was sent to ChatGPT | | `data.response` | `string` | The full text response from ChatGPT | | `data.references` | `array` | Sources and references cited in the ChatGPT response | | `data.references[].url` | `string` | URL of the cited source | | `data.references[].title` | `string` | Title of the cited source | | `data.references[].snippet` | `string` | Snippet or description of the cited source | > Scrapes ChatGPT for AI visibility monitoring. --- ## Gemini Scraper *Source: seo-ai-optimization/gemini.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/ai/gemini', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keyword: 'best seo tools for startups', location: 'us' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/ai/gemini \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keyword": "best seo tools for startups", "location": "us"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keyword` | `string` | Yes | Query to send to Gemini | — | | `location` | `string` | No | Country code | `"us"` | ### Response **Response:** ```json { "ok": true, "data": { "keyword": "best seo tools for startups", "response": "For startups looking to improve their SEO, several tools stand out based on pricing, features, and ease of use...", "references": [ { "url": "https://ahrefs.com/blog/seo-tools", "title": "12 Best SEO Tools in 2026", "snippet": "A curated list of SEO tools..." }, { "url": "https://www.searchenginejournal.com/best-seo-tools", "title": "Top SEO Tools Reviewed", "snippet": "Expert reviews of the best..." } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.keyword` | `string` | The query that was sent to Gemini | | `data.response` | `string` | The full text response from Google Gemini | | `data.references` | `array` | Sources and references cited in the Gemini response | | `data.references[].url` | `string` | URL of the cited source | | `data.references[].title` | `string` | Title of the cited source | | `data.references[].snippet` | `string` | Snippet or description of the cited source | > Scrapes Google Gemini for AI visibility monitoring. --- ## Anchor Text Analysis *Source: seo-backlinks/anchors.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/backlinks/anchors', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ target: 'vercel.com', limit: 50 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/backlinks/anchors \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"target": "vercel.com", "limit": 50}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `target` | `string` | Yes | Domain to analyze anchor text for | — | | `limit` | `number` | No | Maximum number of anchors to return | `100` | ### Response **Response:** ```json { "ok": true, "data": { "target": "vercel.com", "anchors": [ { "anchor": "", "backlinks": 556528, "dofollow": 0, "firstSeen": "2019-01-16", "lastSeen": "", "referringDomains": 3809 }, { "anchor": "Vercel", "backlinks": 662041, "dofollow": 0, "firstSeen": "2020-02-17", "lastSeen": "", "referringDomains": 13396 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.target` | `string` | The domain that was analyzed | | `data.anchors` | `array` | List of anchor texts used in backlinks to the target | | `data.anchors[].anchor` | `string` | The anchor text string (empty string for image or non-text links) | | `data.anchors[].backlinks` | `number` | Total number of backlinks using this anchor text | | `data.anchors[].dofollow` | `number` | Number of dofollow backlinks using this anchor text | | `data.anchors[].firstSeen` | `string` | Date this anchor text was first discovered | | `data.anchors[].lastSeen` | `string` | Date this anchor text was last confirmed (empty if still active) | | `data.anchors[].referringDomains` | `number` | Number of unique domains using this anchor text | > Returns anchor text distribution sorted by backlink count. --- ## Backlinks List *Source: seo-backlinks/backlinks-list.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/backlinks/list', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ target: 'vercel.com', limit: 100 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/backlinks/list \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"target": "vercel.com", "limit": 100}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `target` | `string` | Yes | Domain, subdomain, or URL to get backlinks for | — | | `limit` | `number` | No | Maximum number of backlinks to return | `100` | ### Response **Response:** ```json { "ok": true, "data": { "target": "vercel.com", "backlinks": [ { "anchor": "Vercel", "dofollow": true, "domainAuthority": 532.0, "firstSeen": "2025-07-01", "from": "https://ui.shadcn.com/", "fromDomain": "ui.shadcn.com", "lastSeen": "2026-03-15", "spamScore": 0.0, "status": "active", "to": "https://vercel.com/new?utm_source=shadcn_site&utm_medium=web&utm_campaign=docs_cta_deploy_now_callout" }, { "anchor": "Official site", "dofollow": true, "domainAuthority": 389.0, "firstSeen": "2025-12-05", "from": "https://dedoo.xyz/", "fromDomain": "dedoo.xyz", "lastSeen": "2026-02-19", "spamScore": 0.0, "status": "active", "to": "https://lebowskis.vercel.com/" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.target` | `string` | The target domain that was analyzed | | `data.backlinks` | `array` | List of individual backlinks pointing to the target | | `data.backlinks[].anchor` | `string` | The anchor text used in the backlink | | `data.backlinks[].dofollow` | `boolean` | Whether the link passes link equity (dofollow) | | `data.backlinks[].domainAuthority` | `number` | Authority score of the referring domain | | `data.backlinks[].firstSeen` | `string` | Date the backlink was first discovered | | `data.backlinks[].from` | `string` | Full URL of the page containing the backlink | | `data.backlinks[].fromDomain` | `string` | Domain of the page containing the backlink | | `data.backlinks[].lastSeen` | `string` | Date the backlink was last confirmed active | | `data.backlinks[].spamScore` | `number` | Spam likelihood score of the referring domain (0-100) | | `data.backlinks[].status` | `string` | Current status of the backlink (e.g. `"active"`) | | `data.backlinks[].to` | `string` | Full destination URL the backlink points to | > Queries backlink index in real-time. Results sorted by domain rank. --- ## Backlink Summary *Source: seo-backlinks/backlinks-summary.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/backlinks/summary', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ target: 'vercel.com' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/backlinks/summary \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"target": "vercel.com"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `target` | `string` | Yes | Domain to get backlink summary for | — | ### Response **Response:** ```json { "ok": true, "data": { "target": "vercel.com", "totalBacklinks": 12400000, "referringDomains": 45000, "referringIps": 32000, "dofollowBacklinks": 9800000, "nofollowBacklinks": 2600000, "brokenBacklinks": 145000, "domainRank": 89 } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.target` | `string` | The domain that was analyzed | | `data.totalBacklinks` | `number` | Total number of backlinks pointing to the target | | `data.referringDomains` | `number` | Number of unique domains linking to the target | | `data.referringIps` | `number` | Number of unique IP addresses linking to the target | | `data.dofollowBacklinks` | `number` | Number of backlinks that pass link equity (dofollow) | | `data.nofollowBacklinks` | `number` | Number of backlinks marked as nofollow | | `data.brokenBacklinks` | `number` | Number of backlinks pointing to broken or non-existent pages | | `data.domainRank` | `number` | Overall domain authority rank score | > Provides a high-level overview of a domain's backlink profile in a single call. --- ## Domain Intersection *Source: seo-backlinks/domain-intersection.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/backlinks/domain-intersection', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ targets: ['vercel.com', 'netlify.com'], excludeTargets: ['mysite.com'], limit: 50 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/backlinks/domain-intersection \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"targets": ["vercel.com", "netlify.com"], "excludeTargets": ["mysite.com"], "limit": 50}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `targets` | `string[]` | Yes | Domains to find common backlinks for | — | | `excludeTargets` | `string[]` | No | Domains to exclude | — | | `limit` | `number` | No | Maximum number of intersections to return | `100` | ### Response **Response:** ```json { "ok": true, "data": { "intersections": [] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.intersections` | `array` | List of domains that link to multiple specified targets. Each entry represents a referring domain shared across the targets. | > Compares backlink profiles across multiple domains to find shared link sources. --- ## Page Intersection *Source: seo-backlinks/page-intersection.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/backlinks/page-intersection', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ targets: ['vercel.com', 'netlify.com'], limit: 50 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/backlinks/page-intersection \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"targets": ["vercel.com", "netlify.com"], "limit": 50}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `targets` | `string[]` | Yes | Domains to find common backlinks for | — | | `excludeTargets` | `string[]` | No | Domains to exclude | — | | `limit` | `number` | No | Maximum number of intersections to return | `100` | ### Response **Response:** ```json { "ok": true, "data": { "intersections": [] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.intersections` | `array` | List of individual pages that link to multiple specified targets. Each entry represents a specific page URL shared across the targets. | > Page-level intersection analysis for precise link prospecting. --- ## Referring Domains *Source: seo-backlinks/referring-domains.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/backlinks/referring-domains', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ target: 'vercel.com', limit: 50 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/backlinks/referring-domains \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"target": "vercel.com", "limit": 50}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `target` | `string` | Yes | Domain to get referring domains for | — | | `limit` | `number` | No | Maximum number of referring domains to return | `100` | ### Response **Response:** ```json { "ok": true, "data": { "target": "vercel.com", "referringDomains": [ { "backlinks": 19307, "dofollow": 0, "domain": "", "firstSeen": "2020-11-23", "lastSeen": "", "rank": 516.0 }, { "backlinks": 527338, "dofollow": 0, "domain": "", "firstSeen": "2024-09-13", "lastSeen": "", "rank": 480.0 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.target` | `string` | The domain that was analyzed | | `data.referringDomains` | `array` | List of domains that link to the target | | `data.referringDomains[].backlinks` | `number` | Total number of backlinks from this referring domain | | `data.referringDomains[].dofollow` | `number` | Number of dofollow backlinks from this referring domain | | `data.referringDomains[].domain` | `string` | The referring domain name | | `data.referringDomains[].firstSeen` | `string` | Date the referring domain was first discovered linking to the target | | `data.referringDomains[].lastSeen` | `string` | Date the referring domain was last confirmed linking (empty if still active) | | `data.referringDomains[].rank` | `number` | Authority rank score of the referring domain | > Returns referring domains sorted by domain rank. --- ## Domain Competitors *Source: seo-competitors/domain-competitors.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/competitors/domain', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ domain: 'stripe.com', location_code: 2840, language: 'en', limit: 100, }), }); const { data } = await res.json(); console.log(data.competitors); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/competitors/domain \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domain": "stripe.com", "location_code": 2840, "language": "en", "limit": 100}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `domain` | `string` | Yes | Domain to find competitors for (without protocol) | — | | `location_code` | `number` | No | Target country code. See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code | `"en"` | | `limit` | `number` | No | Max competitor domains to return | `100` | ### Response **Response:** ```json { "ok": true, "data": { "domain": "vercel.com", "competitors": [ { "avgPosition": 51.85, "domain": "vercel.com", "intersections": 39218, "organicCount": 39217, "organicEtv": 154912.38 }, { "avgPosition": 21.18, "domain": "youtube.com", "intersections": 36760, "organicCount": 36760, "organicEtv": 147161.67 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.domain` | `string` | The domain that was analyzed | | `data.competitors` | `array` | List of competitor domains ranked by keyword overlap | | `data.competitors[].domain` | `string` | Competitor domain name | | `data.competitors[].avgPosition` | `number` | Average ranking position across overlapping keywords | | `data.competitors[].intersections` | `number` | Number of keywords both domains rank for | | `data.competitors[].organicCount` | `number` | Total number of organic keywords the competitor ranks for | | `data.competitors[].organicEtv` | `number` | Estimated traffic value from organic keywords (USD) | --- ## Keyword Gap Analysis *Source: seo-competitors/keyword-gap.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/competitors/keywords', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ domain1: 'stripe.com', domain2: 'square.com', intersections: true, location_code: 2840, language: 'en', limit: 100, }), }); const { data } = await res.json(); console.log(data.keywords); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/competitors/keywords \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domain1": "stripe.com", "domain2": "square.com", "intersections": true, "location_code": 2840, "limit": 100}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `domain1` | `string` | Yes | Primary domain (without protocol) | — | | `domain2` | `string` | Yes | Competitor domain (without protocol) | — | | `intersections` | `boolean` | No | `true` = shared keywords, `false` = keywords only domain1 ranks for | `true` | | `location_code` | `number` | No | Target country code. See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code | `"en"` | | `limit` | `number` | No | Max keywords to return | `100` | > Set `intersections: false` for keyword gap mode — returns keywords that domain1 ranks for but domain2 doesn't. This is how you find opportunities your competitors are missing. ### Response **Response:** ```json { "ok": true, "data": { "domain1": "stripe.com", "domain2": "square.com", "intersections": true, "keywords": [ { "keyword": "payment processing", "volume": 33100, "cpc": 15.2, "competition": 0.85, "difficulty": 72, "intent": "commercial", "domain1": { "position": 3, "url": "https://stripe.com/payments", "etv": 4500.0 }, "domain2": { "position": 7, "url": "https://square.com/payments", "etv": 1200.0 } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.domain1` | `string` | The primary domain analyzed | | `data.domain2` | `string` | The competitor domain analyzed | | `data.intersections` | `boolean` | Whether the results show shared keywords or gap keywords | | `data.keywords` | `array` | List of keywords with ranking data for both domains | | `data.keywords[].keyword` | `string` | The keyword | | `data.keywords[].volume` | `number` | Monthly search volume | | `data.keywords[].cpc` | `number` | Average cost per click (USD) | | `data.keywords[].competition` | `number` | Competition level (0-1) | | `data.keywords[].difficulty` | `number` | Keyword difficulty score (0-100) | | `data.keywords[].intent` | `string` | Search intent (`informational`, `navigational`, `commercial`, `transactional`) | | `data.keywords[].domain1` | `object` | Ranking data for the primary domain | | `data.keywords[].domain1.position` | `number` | SERP position for domain1 | | `data.keywords[].domain1.url` | `string` | Ranking URL for domain1 | | `data.keywords[].domain1.etv` | `number` | Estimated traffic value for domain1 (USD) | | `data.keywords[].domain2` | `object` | Ranking data for the competitor domain | | `data.keywords[].domain2.position` | `number` | SERP position for domain2 | | `data.keywords[].domain2.url` | `string` | Ranking URL for domain2 | | `data.keywords[].domain2.etv` | `number` | Estimated traffic value for domain2 (USD) | --- ## Page Intersection *Source: seo-competitors/page-intersection.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/competitors/pages', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ pages: { '1': 'stripe.com/payments', '2': 'square.com/payments', }, location_code: 2840, language: 'en', limit: 100, }), }); const { data } = await res.json(); console.log(data.keywords); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/competitors/pages \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"pages": {"1": "stripe.com/payments", "2": "square.com/payments"}, "location_code": 2840, "limit": 100}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `pages` | `object` | Yes | Numbered keys (`"1"`, `"2"`, etc.) mapping to page URLs. Up to 20. | — | | `location_code` | `number` | No | Target country code. See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code | `"en"` | | `limit` | `number` | No | Max keywords to return | `100` | > Pages support wildcard patterns like `stripe.com/blog/*` to match all URLs under a path. ### Response **Response:** ```json { "ok": true, "data": { "keywords": [ { "keyword": "payment processing api", "volume": 2400, "cpc": 18.5, "competition": 0.82, "difficulty": 68, "intent": "commercial", "pages": [ { "url": "https://stripe.com/payments", "position": 2, "type": "organic", "etv": 650.0 }, { "url": "https://square.com/payments", "position": 5, "type": "organic", "etv": 180.0 } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.keywords` | `array` | List of keywords where the specified pages intersect in search results | | `data.keywords[].keyword` | `string` | The keyword | | `data.keywords[].volume` | `number` | Monthly search volume | | `data.keywords[].cpc` | `number` | Average cost per click (USD) | | `data.keywords[].competition` | `number` | Competition level (0-1) | | `data.keywords[].difficulty` | `number` | Keyword difficulty score (0-100) | | `data.keywords[].intent` | `string` | Search intent (`informational`, `navigational`, `commercial`, `transactional`) | | `data.keywords[].pages` | `array` | Ranking data for each page that ranks for this keyword | | `data.keywords[].pages[].url` | `string` | The ranking page URL | | `data.keywords[].pages[].position` | `number` | SERP position for this page | | `data.keywords[].pages[].type` | `string` | Result type (e.g. `organic`) | | `data.keywords[].pages[].etv` | `number` | Estimated traffic value for this page (USD) | --- ## SERP Competitors *Source: seo-competitors/serp-competitors.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/competitors/serp', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords: ['seo tools', 'keyword research', 'backlink checker'], location_code: 2840, language: 'en', limit: 100, }), }); const { data } = await res.json(); console.log(data.competitors); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/competitors/serp \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keywords": ["seo tools", "keyword research"], "location_code": 2840, "language": "en", "limit": 100}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keywords` | `string[]` | Yes | Keywords to analyze (up to 200) | — | | `location_code` | `number` | No | Target country code. See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code | `"en"` | | `limit` | `number` | No | Max competitor domains to return | `100` | ### Response **Response:** ```json { "ok": true, "data": { "competitors": [ { "avgPosition": 1.0, "domain": "nextjs.org", "etv": 15048.0, "keywordsCount": 1, "medianPosition": 1, "rating": 99, "visibility": 1.0 }, { "avgPosition": 2.0, "domain": "en.wikipedia.org", "etv": 8019.0, "keywordsCount": 1, "medianPosition": 2, "rating": 98, "visibility": 0.9 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.competitors` | `array` | List of competing domains for the given keywords | | `data.competitors[].domain` | `string` | Competitor domain name | | `data.competitors[].avgPosition` | `number` | Average ranking position across the target keywords | | `data.competitors[].medianPosition` | `number` | Median ranking position across the target keywords | | `data.competitors[].rating` | `number` | Competitor relevance rating (0-100, higher = more competitive) | | `data.competitors[].etv` | `number` | Estimated traffic value from the target keywords (USD) | | `data.competitors[].keywordsCount` | `number` | Number of target keywords this competitor ranks for | | `data.competitors[].visibility` | `number` | Search visibility score (0-1, higher = more visible) | --- ## "Content Search" *Source: seo-content/search.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/content/search', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ "keyword": "vibe coding", "limit": 50 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/content/search \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keyword":"vibe coding","limit":50}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keyword` | `string` | Yes | Keyword to search for | — | | `limit` | `number` | No | Number of results to return | `100` | ### Response **Response:** ```json { "ok": true, "data": { "keyword": "nextjs seo", "results": [ { "contentQualityScore": 0.0, "datePublished": "", "domain": "codecheap.org", "sentiment": "neutral", "snippet": "", "spamScore": 0.0, "title": "", "url": "https://codecheap.org/downloads/lums-v-1-0-seo-landing-react-nextjs-template/" }, { "contentQualityScore": 0.0, "datePublished": "", "domain": "jakarta.telkomuniversity.ac.id", "sentiment": "neutral", "snippet": "", "spamScore": 0.0, "title": "", "url": "https://jakarta.telkomuniversity.ac.id/tag/nextjs/" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.keyword` | `string` | The keyword that was searched | | `data.results` | `array` | List of content results matching the keyword | | `data.results[].url` | `string` | URL of the content piece | | `data.results[].domain` | `string` | Domain where the content is hosted | | `data.results[].title` | `string` | Title of the content piece | | `data.results[].snippet` | `string` | Text snippet or excerpt from the content | | `data.results[].datePublished` | `string` | Date the content was published | | `data.results[].sentiment` | `string` | Sentiment classification (`positive`, `negative`, or `neutral`) | | `data.results[].contentQualityScore` | `number` | Content quality score (0-1, higher is better) | | `data.results[].spamScore` | `number` | Spam likelihood score (0-1, lower is better) | > Searches across the web for content mentioning your keyword. --- ## "Content Sentiment" *Source: seo-content/sentiment.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/content/sentiment', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ "keyword": "vercel", "limit": 50 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/content/sentiment \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keyword":"vercel","limit":50}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keyword` | `string` | Yes | Keyword to analyze | — | | `limit` | `number` | No | Number of results to return | `100` | ### Response **Response:** ```json { "ok": true, "data": { "keyword": "vercel", "results": [ { "url": "https://blog.example.com/vercel-review", "domain": "blog.example.com", "title": "Vercel Review 2026", "sentiment": "positive", "sentimentScore": 0.85, "date": "2026-03-20" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.keyword` | `string` | The keyword that was analyzed | | `data.results` | `array` | List of content pieces with sentiment analysis | | `data.results[].url` | `string` | URL of the content piece | | `data.results[].domain` | `string` | Domain where the content is hosted | | `data.results[].title` | `string` | Title of the content piece | | `data.results[].sentiment` | `string` | Sentiment classification (`positive`, `negative`, or `neutral`) | | `data.results[].sentimentScore` | `number` | Sentiment confidence score (0-1, higher = stronger sentiment) | | `data.results[].date` | `string` | Date the content was published | > Sentiment analysis powered by content intelligence. --- ## "Content Summary" *Source: seo-content/summary.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/content/summary', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ "keyword": "vibe coding" }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/content/summary \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keyword":"vibe coding"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keyword` | `string` | Yes | Keyword to analyze | — | ### Response **Response:** ```json { "ok": true, "data": { "avgContentQualityScore": 0.0, "keyword": "nextjs seo", "sentimentDistribution": { "negative": 0, "neutral": 0, "positive": 0 }, "totalCount": 15607 } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.keyword` | `string` | The keyword that was analyzed | | `data.totalCount` | `number` | Total number of content pieces found for this keyword | | `data.avgContentQualityScore` | `number` | Average content quality score across all results (0-1) | | `data.sentimentDistribution` | `object` | Breakdown of sentiment across all content | | `data.sentimentDistribution.positive` | `number` | Count of content pieces with positive sentiment | | `data.sentimentDistribution.negative` | `number` | Count of content pieces with negative sentiment | | `data.sentimentDistribution.neutral` | `number` | Count of content pieces with neutral sentiment | > High-level content landscape analysis in a single call. --- ## Domain Availability *Source: seo-domain/domain-available.mdx* Check whether one or many domains are available to register. Returns premium-name flags with registration and renewal pricing, plus ICANN and Early Access Program (EAP) fees. ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/domain/available', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ domains: ['example.com', 'example.io', 'example.ai'], }), }); const { data } = await res.json(); console.log(data.domains); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/domain/available \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domains": ["example.com", "example.io", "example.ai"]}' ``` ### Request Body Provide **either** `domain` (single) or `domains` (array of up to 50). | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `domain` | `string` | One of `domain` / `domains` | Single domain to check (no protocol, e.g. `example.com`) | — | | `domains` | `string[]` | One of `domain` / `domains` | Up to 50 domains to check in one call | — | ### Response **Response:** ```json { "ok": true, "data": { "domains": [ { "domain": "example.com", "available": false, "isPremium": false, "premiumRegistrationPrice": 0, "premiumRenewalPrice": 0, "icannFee": 0, "eapFee": 0 }, { "domain": "some-unique-name-xyz-123.com", "available": true, "isPremium": false, "premiumRegistrationPrice": 0, "premiumRenewalPrice": 0, "icannFee": 0.18, "eapFee": 0 }, { "domain": "cars.ai", "available": true, "isPremium": true, "premiumRegistrationPrice": 2450, "premiumRenewalPrice": 95, "icannFee": 0, "eapFee": 0 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.domains` | `array` | One entry per input domain, in the same order | | `data.domains[].domain` | `string` | The checked domain | | `data.domains[].available` | `boolean` | `true` if the domain can be registered right now | | `data.domains[].isPremium` | `boolean` | `true` if the upstream registry classifies the domain as a premium name | | `data.domains[].premiumRegistrationPrice` | `number` | Registration price in USD for premium domains (`0` otherwise) | | `data.domains[].premiumRenewalPrice` | `number` | Renewal price in USD for premium domains (`0` otherwise) | | `data.domains[].icannFee` | `number` | ICANN fee in USD (`0` if none) | | `data.domains[].eapFee` | `number` | Early Access Program fee in USD (`0` if none) | | `data.domains[].error` | `string?` | Only present when an individual domain check failed (e.g. unsupported TLD) | ### Errors | Code | HTTP | When | | :--- | :--- | :--- | | `VALIDATION_ERROR` | 400 | Neither `domain` nor `domains` provided, or more than 50 domains sent | | `UPSTREAM_ERROR` | 502 | Upstream registry connectivity problem | > Real-time availability via a registrar's domain-check API. --- ## Domain Backlinks *Source: seo-domain/domain-backlinks.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/domain/backlinks', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ domain: 'github.com', limit: 100 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/domain/backlinks \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domain": "github.com", "limit": 100}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `domain` | `string` | Yes | Domain to get backlinks for (without protocol, e.g., `"github.com"`) | — | | `limit` | `number` | No | Maximum number of backlinks to return | `100` | ### Response **Response:** ```json { "ok": true, "data": [ { "sourceUrl": "https://blog.example.com/tools-review", "sourceDomain": "blog.example.com", "anchorText": "GitHub", "isDofollow": true, "domainAuthority": 72, "firstSeen": "2025-08-14" } ] } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.domain` | `string` | The target domain that was analyzed | | `data.totalBacklinks` | `number` | Total number of backlinks found | | `data.backlinks` | `object[]` | Array of backlink results | | `data.backlinks[].from` | `string` | Full URL of the page linking to the target | | `data.backlinks[].fromDomain` | `string` | Domain of the referring page | | `data.backlinks[].to` | `string` | URL on the target domain being linked to | | `data.backlinks[].anchor` | `string` | Anchor text of the backlink | | `data.backlinks[].dofollow` | `boolean` | Whether the link passes SEO authority | | `data.backlinks[].domainAuthority` | `number` | Authority score of the referring domain | | `data.backlinks[].firstSeen` | `string` | Date when the backlink was first detected (ISO format) | > Under the hood, this queries our SEO data engine for all backlinks pointing to the specified domain. We normalize the response and include authority scores and link attributes. --- ## Domain Keywords *Source: seo-domain/domain-keywords.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/domain/keywords', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ domain: 'stripe.com', limit: 100 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/domain/keywords \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domain": "stripe.com", "limit": 100}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `domain` | `string` | Yes | Domain to analyze (without protocol, e.g., `"stripe.com"`) | — | | `limit` | `number` | No | Maximum number of keywords to return | `100` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": [ { "keyword": "stripe", "position": 1, "searchVolume": 450000, "cpc": 8.5, "url": "https://stripe.com" }, { "keyword": "payment gateway", "position": 3, "searchVolume": 74000, "cpc": 12.3, "url": "https://stripe.com/payments" } ] } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.domain` | `string` | The domain that was analyzed | | `data.totalKeywords` | `number` | Total number of ranking keywords found | | `data.keywords` | `object[]` | Array of keyword ranking results | | `data.keywords[].keyword` | `string` | The keyword the domain ranks for | | `data.keywords[].position` | `number` | Current organic position in search results | | `data.keywords[].searchVolume` | `number` | Estimated monthly search volume | | `data.keywords[].cpc` | `number` | Average cost-per-click in USD | | `data.keywords[].url` | `string` | URL of the ranking page on this domain | | `data.keywords[].traffic` | `number` | Estimated monthly organic traffic from this keyword | > Under the hood, this queries our SEO data engine for all organic keyword rankings of the specified domain. We normalize positions, volumes, and URLs into a clean response format. --- ## Domain Metrics *Source: seo-domain/domain-metrics.mdx* Ahrefs-style authority and traffic metrics in a single call. Returns Domain Rating (DR), URL Rating (UR), Ahrefs rank, backlinks, referring domains, estimated traffic, traffic value (USD), and organic keywords — at both the page level and the domain level. ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/domain/metrics', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ domain: 'anthropic.com' }), }); const { data } = await res.json(); console.log(data.domainMetrics.domainRating); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/domain/metrics \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domain": "anthropic.com"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `domain` | `string` | Yes | Domain or URL to analyze. `http(s)://` is stripped automatically. | — | ### Response **Response:** ```json { "ok": true, "data": { "target": "anthropic.com", "page": { "backlinks": 34425, "refDomains": 3870, "traffic": 0, "trafficValue": 0, "organicKeywords": 0, "urlRating": 16, "numberOfWordsOnPage": 0 }, "domainMetrics": { "domainRating": 91, "ahrefsRank": 693, "domainRank": 693, "backlinks": 1911955, "refDomains": 85326, "traffic": 981693, "trafficValue": 382569.64, "organicKeywords": 11757 } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `data.target` | `string` | The domain we queried (echoed back, protocol stripped) | | `data.page.backlinks` | `number` | Backlinks pointing specifically to the queried page / root | | `data.page.refDomains` | `number` | Unique referring domains linking to that page | | `data.page.traffic` | `number` | Estimated monthly organic traffic for the page | | `data.page.trafficValue` | `number` | Estimated USD value of that traffic | | `data.page.organicKeywords` | `number` | Keywords the page ranks for | | `data.page.urlRating` | `number` | URL Rating (0–100) for the page | | `data.page.numberOfWordsOnPage` | `number` | Word count of the page | | `data.domainMetrics.domainRating` | `number` | Domain Rating (0–100) | | `data.domainMetrics.ahrefsRank` | `number` | Ahrefs rank — global domain position (1 = best) | | `data.domainMetrics.domainRank` | `number` | Alias of `ahrefsRank` returned by the upstream | | `data.domainMetrics.backlinks` | `number` | Total backlinks across the domain | | `data.domainMetrics.refDomains` | `number` | Unique referring domains to the whole domain | | `data.domainMetrics.traffic` | `number` | Estimated monthly organic traffic for the domain | | `data.domainMetrics.trafficValue` | `number` | Estimated USD value of domain traffic | | `data.domainMetrics.organicKeywords` | `number` | Total keywords the domain ranks for | > Distinct from `/v1/seo/domain/overview` — this endpoint reports Ahrefs-style DR/UR and traffic value, while the overview endpoint reports a different authority rank scale. --- ## Domain Metrics *Source: seo-domain/domain-overview.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/domain/overview', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ domain: 'vercel.com', location_code: 2840 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/domain/overview \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domain": "vercel.com", "location_code": 2840}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `domain` | `string` | Yes | Domain to analyze (without protocol) | — | | `location_code` | `number` | No | Target country code. See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "domain": "vercel.com", "domainRank": 742.3, "organicTraffic": 2450000, "organicKeywords": 156000, "backlinks": 12400000, "referringDomains": 45000 } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.domain` | `string` | The domain that was analyzed | | `data.domainRank` | `number` | Domain authority rank score | | `data.organicTraffic` | `number` | Estimated monthly organic search traffic | | `data.organicKeywords` | `number` | Total number of organic keywords the domain ranks for | | `data.backlinks` | `number` | Total number of backlinks pointing to the domain | | `data.referringDomains` | `number` | Number of unique domains linking to the target | > This combines domain analytics and backlink data into one clean response. Multiple data sources merged into a single call. --- ## Domain Technologies *Source: seo-domain/domain-technologies.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/domain/technologies', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ domain: 'vercel.com' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/domain/technologies \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domain": "vercel.com"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `domain` | `string` | Yes | Domain to analyze (without protocol) | — | ### Response **Response:** ```json { "ok": true, "data": { "domain": "vercel.com", "technologies": [] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.domain` | `string` | The domain that was analyzed | | `data.technologies` | `array` | List of technologies detected on the domain (CMS, analytics, frameworks, etc.) | > Detects technologies via domain analytics. --- ## WHOIS Lookup *Source: seo-domain/domain-whois.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/domain/whois', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ domain: 'vercel.com' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/domain/whois \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domain": "vercel.com"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `domain` | `string` | Yes | Domain to look up (without protocol) | — | ### Response **Response:** ```json { "ok": true, "data": { "domain": "youtube.com", "registrar": "MarkMonitor Inc.", "createdDate": "", "updatedDate": "", "expiryDate": "", "nameServers": [] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.domain` | `string` | The domain that was looked up | | `data.registrar` | `string` | The domain registrar company | | `data.createdDate` | `string` | Domain registration creation date (ISO format, empty if unavailable) | | `data.updatedDate` | `string` | Date the WHOIS record was last updated (empty if unavailable) | | `data.expiryDate` | `string` | Domain expiration date (empty if unavailable) | | `data.nameServers` | `string[]` | List of authoritative nameservers for the domain | > Real-time WHOIS data. --- ## Content Scoring *Source: seo-keywords/content-score.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/content/score', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://myblog.com/nextjs-guide', keyword: 'nextjs tutorial', }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/content/score \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://myblog.com/nextjs-guide", "keyword": "nextjs tutorial"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | URL of the page to score | — | | `keyword` | `string` | Yes | Target keyword to optimize for | — | ### Response **Response:** ```json { "ok": true, "data": { "overallScore": 72, "readability": 85, "keywordUsage": 65, "headingStructure": 80, "metaTitle": { "score": 90, "value": "Complete Next.js Tutorial for Beginners", "length": 42 }, "metaDescription": { "score": 60, "value": "Learn Next.js...", "length": 14 }, "wordCount": 2450, "recommendations": [ "Add target keyword to meta description", "Include more heading variations (H3, H4)", "Add internal links to related content" ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.overallScore` | `number` | Overall SEO content score (0-100) | | `data.readability` | `number` | Readability score (0-100) | | `data.keywordUsage` | `number` | Keyword usage and density score (0-100) | | `data.headingStructure` | `number` | Heading hierarchy and structure score (0-100) | | `data.metaTitle` | `object` | Meta title analysis | | `data.metaTitle.score` | `number` | Meta title optimization score (0-100) | | `data.metaTitle.value` | `string` | The actual meta title text | | `data.metaTitle.length` | `number` | Character length of the meta title | | `data.metaDescription` | `object` | Meta description analysis | | `data.metaDescription.score` | `number` | Meta description optimization score (0-100) | | `data.metaDescription.value` | `string` | The actual meta description text | | `data.metaDescription.length` | `number` | Character length of the meta description | | `data.wordCount` | `number` | Total word count of the page content | | `data.recommendations` | `string[]` | Actionable SEO improvement suggestions | --- ## Keyword Ideas *Source: seo-keywords/keywords-ideas.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/keywords/ideas', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keyword: 'react framework', limit: 50 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/keywords/ideas \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keyword": "react framework", "limit": 50}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keyword` | `string` | Yes | Seed keyword to generate ideas from (e.g., `"react framework"`) | — | | `limit` | `number` | No | Maximum number of keyword ideas to return | `50` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "seed": "email marketing", "keywords": [ { "keyword": "marketing email platforms", "volume": 22200, "cpc": 72.63, "difficulty": 77, "competition": 0.2, "competitionLevel": "LOW", "intent": "commercial", "avgBacklinks": 97860.5, "avgReferringDomains": 9312.9, "serpFeatures": [], "totalResults": 0, "trend": [ { "month": "2026-02", "volume": 9900 }, { "month": "2026-01", "volume": 14800 }, { "month": "2025-12", "volume": 33100 } ] }, { "keyword": "email marketing platform", "volume": 22200, "cpc": 72.63, "difficulty": 80, "competition": 0.2, "competitionLevel": "LOW", "intent": "commercial", "avgBacklinks": 119229.5, "avgReferringDomains": 9397.5, "serpFeatures": [], "totalResults": 0, "trend": [ { "month": "2026-02", "volume": 9900 }, { "month": "2026-01", "volume": 14800 }, { "month": "2025-12", "volume": 33100 } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.seed` | `string` | The seed keyword used to generate ideas | | `data.keywords` | `object[]` | Array of keyword idea results | | `data.keywords[].keyword` | `string` | The suggested keyword | | `data.keywords[].volume` | `number` | Average monthly search volume | | `data.keywords[].cpc` | `number` | Cost per click in USD | | `data.keywords[].difficulty` | `number` | SEO difficulty score (0-100) | | `data.keywords[].competition` | `number` | PPC competition index (0-1) | | `data.keywords[].competitionLevel` | `string` | Competition category (`LOW`, `MEDIUM`, `HIGH`, or `unknown`) | | `data.keywords[].intent` | `string` | Search intent (`informational`, `commercial`, `navigational`, `transactional`, or `unknown`) | | `data.keywords[].avgBacklinks` | `number` | Average number of backlinks for top-ranking pages | | `data.keywords[].avgReferringDomains` | `number` | Average number of referring domains for top-ranking pages | | `data.keywords[].serpFeatures` | `string[]` | SERP features present for this keyword | | `data.keywords[].totalResults` | `number` | Total number of search results | | `data.keywords[].trend` | `object[]` | Monthly search volume trend data | | `data.keywords[].trend[].month` | `string` | Month in `YYYY-MM` format | | `data.keywords[].trend[].volume` | `number` | Search volume for that month | > Under the hood, this queries our SEO data engine for keyword suggestions based on your seed term. We normalize the response and return clean camelCase fields. --- ## Related Keywords *Source: seo-keywords/keywords-related.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/keywords/related', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keyword: 'email marketing', limit: 50 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/keywords/related \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keyword": "email marketing", "limit": 50}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keyword` | `string` | Yes | Seed keyword to find related terms for (e.g., `"email marketing"`) | — | | `limit` | `number` | No | Maximum number of related keywords to return | `50` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "seed": "email marketing", "keywords": [ { "keyword": "email marketing", "volume": 18100, "cpc": 46.41, "difficulty": 73, "competition": 0.17, "competitionLevel": "LOW", "intent": "informational", "avgBacklinks": 5295.1, "avgReferringDomains": 708.5, "serpFeatures": [ "images", "organic", "peopleAlsoAsk", "video", "perspectives", "relatedSearches" ], "totalResults": 2370000000, "trend": [ { "month": "2026-03", "volume": 27100 }, { "month": "2026-02", "volume": 14800 }, { "month": "2026-01", "volume": 12100 } ] }, { "keyword": "email marketing jobs", "volume": 2900, "cpc": 3.95, "difficulty": 7, "competition": 0.12, "competitionLevel": "LOW", "intent": "informational", "avgBacklinks": 177.4, "avgReferringDomains": 6.7, "serpFeatures": [ "jobs", "organic", "peopleAlsoAsk", "relatedSearches" ], "totalResults": 1840000000, "trend": [ { "month": "2026-03", "volume": 2400 }, { "month": "2026-02", "volume": 2400 }, { "month": "2026-01", "volume": 2900 } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.seed` | `string` | The seed keyword used to find related terms | | `data.keywords` | `object[]` | Array of related keyword results | | `data.keywords[].keyword` | `string` | The related keyword | | `data.keywords[].volume` | `number` | Average monthly search volume | | `data.keywords[].cpc` | `number` | Cost per click in USD | | `data.keywords[].difficulty` | `number` | SEO difficulty score (0-100) | | `data.keywords[].competition` | `number` | PPC competition index (0-1) | | `data.keywords[].competitionLevel` | `string` | Competition category (`LOW`, `MEDIUM`, `HIGH`, or `unknown`) | | `data.keywords[].intent` | `string` | Search intent (`informational`, `commercial`, `navigational`, `transactional`, or `unknown`) | | `data.keywords[].avgBacklinks` | `number` | Average number of backlinks for top-ranking pages | | `data.keywords[].avgReferringDomains` | `number` | Average number of referring domains for top-ranking pages | | `data.keywords[].serpFeatures` | `string[]` | SERP features present for this keyword (e.g., `images`, `video`, `jobs`, `peopleAlsoAsk`) | | `data.keywords[].totalResults` | `number` | Total number of search results | | `data.keywords[].trend` | `object[]` | Monthly search volume trend data | | `data.keywords[].trend[].month` | `string` | Month in `YYYY-MM` format | | `data.keywords[].trend[].volume` | `number` | Search volume for that month | > Under the hood, this queries our SEO data engine for semantically related terms. These are terms searchers also look for, not just string variations of the seed keyword. --- ## Keyword Research *Source: seo-keywords/keywords.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/keywords', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords: ['nextjs seo', 'vibe coding'], location_code: 2840 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/keywords \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keywords": ["nextjs seo", "vibe coding"], "location_code": 2840}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keywords` | `string[]` | Yes | Array of keywords to analyze (max 100) | — | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | > We support 90+ countries via `location_code`. See the full list at [Location Codes Reference](/reference/location-codes). You can also pass a `location` string (e.g. `"us"`) as a fallback. ### Response **Response:** ```json { "ok": true, "data": { "keywords": [ { "keyword": "nextjs seo", "volume": 390, "cpc": 0.0, "difficulty": 0, "competition": 0.01, "competitionLevel": "LOW", "intent": "unknown", "avgBacklinks": 0.0, "avgReferringDomains": 0.0, "serpFeatures": [], "totalResults": 0, "trend": [ { "month": "2026-03", "volume": 390 }, { "month": "2026-02", "volume": 140 }, { "month": "2026-01", "volume": 170 } ] }, { "keyword": "vibe coding", "volume": 0, "cpc": 0.0, "difficulty": 0, "competition": 0.0, "competitionLevel": "unknown", "intent": "unknown", "avgBacklinks": 0.0, "avgReferringDomains": 0.0, "serpFeatures": [], "totalResults": 0, "trend": [] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.keywords` | `object[]` | Array of keyword analysis results | | `data.keywords[].keyword` | `string` | The analyzed keyword | | `data.keywords[].volume` | `number` | Average monthly search volume | | `data.keywords[].cpc` | `number` | Cost per click in USD | | `data.keywords[].difficulty` | `number` | SEO difficulty score (0-100) | | `data.keywords[].competition` | `number` | PPC competition index (0-1) | | `data.keywords[].competitionLevel` | `string` | Competition category (`LOW`, `MEDIUM`, `HIGH`, or `unknown`) | | `data.keywords[].intent` | `string` | Search intent (`informational`, `commercial`, `navigational`, `transactional`, or `unknown`) | | `data.keywords[].avgBacklinks` | `number` | Average number of backlinks for top-ranking pages | | `data.keywords[].avgReferringDomains` | `number` | Average number of referring domains for top-ranking pages | | `data.keywords[].serpFeatures` | `string[]` | SERP features present for this keyword (e.g., `images`, `video`, `peopleAlsoAsk`) | | `data.keywords[].totalResults` | `number` | Total number of search results | | `data.keywords[].trend` | `object[]` | Monthly search volume trend data | | `data.keywords[].trend[].month` | `string` | Month in `YYYY-MM` format | | `data.keywords[].trend[].volume` | `number` | Search volume for that month | > Under the hood, this queries our SEO data engine for keyword metrics. We normalize the response, map location/language codes automatically, and flatten nested result arrays. --- ## SERP Analysis *Source: seo-keywords/serp.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'best react frameworks 2026', location_code: 2840 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "best react frameworks 2026", "location_code": 2840}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query to analyze | — | | `location_code` | `number` | No | Target country code. See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code | `"en"` | | `depth` | `number` | No | Number of results (10, 20, 50, 100) | `10` | ### Response **Response:** ```json { "ok": true, "data": { "query": "nextjs seo", "totalResults": 3230000, "itemTypes": ["aiOverview", "organic", "peopleAlsoAsk", "relatedSearches"], "results": [ { "position": 1, "type": "aiOverview", "title": "", "url": "", "description": "", "domain": "", "data": { "items": [ { "type": "aiOverviewElement", "title": "Next.js SEO Best Practices", "url": "https://nextjs.org/learn/seo", "domain": "nextjs.org" } ] } }, { "position": 2, "type": "organic", "title": "SEO", "url": "https://nextjs.org/learn/seo", "description": "SEO stands for Search Engine Optimization. The goal of SEO is to create a strategy that will increase your rankings position in search engine results.", "domain": "nextjs.org", "data": { "breadcrumb": "nextjs.org > learn > seo", "websiteName": "Next.js", "isFeaturedSnippet": false, "highlighted": ["SEO"] } }, { "position": 3, "type": "organic", "title": "Next.js SEO Complete Checklist : r/nextjs", "url": "https://www.reddit.com/r/nextjs/comments/195ikpf/nextjs_seo_complete_checklist/", "description": "I wrote this tutorial to show you guys all the necessary things that should be added to your Next.js app to help search engines understand your site better.", "domain": "www.reddit.com", "data": { "breadcrumb": "www.reddit.com > r > nextjs", "websiteName": "Reddit", "isFeaturedSnippet": false, "highlighted": ["Next.js", "SEO"] } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The search query that was analyzed | | `data.totalResults` | `number` | Total number of search results found | | `data.itemTypes` | `string[]` | Distinct result types present in this SERP | | `data.results` | `object[]` | Array of SERP result items | | `data.results[].position` | `number` | Position in the search results | | `data.results[].type` | `string` | Result type — see [Google SERP docs](/serp-api/google#supported-result-types) for the full list of 30+ types | | `data.results[].title` | `string` | Title of the search result | | `data.results[].url` | `string` | URL of the search result | | `data.results[].description` | `string` | Snippet or description shown in the SERP | | `data.results[].domain` | `string` | Domain of the result URL | | `data.results[].data` | `object \| null` | Type-specific extra fields (ratings, sitelinks, breadcrumbs, FAQs, etc.) — see [type-specific fields](/serp-api/google#type-specific-data-fields) | > This is a legacy alias for [`POST /v1/serp/google`](/serp-api/google). Both endpoints return the same response. See the [Google SERP docs](/serp-api/google) for detailed per-type field documentation. --- ## "Content Parsing" *Source: seo-onpage/content-parsing.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/onpage/content', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://vercel.com/blog/next-15" }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/onpage/content \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://vercel.com/blog/next-15"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | Full URL to parse | — | ### Response **Response:** ```json { "ok": true, "data": { "content": [ { "url": "https://vercel.com/blog/next-15", "title": "Introducing Next.js 15", "description": "Next.js 15 brings...", "wordCount": 3200, "automatedReadabilityIndex": 12.5, "colemanLiauIndex": 11.8, "fleschReadingEase": 52.3 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.content` | `array` | List of parsed content items | | `data.content[].url` | `string` | The URL that was parsed | | `data.content[].title` | `string` | Page title extracted from the document | | `data.content[].description` | `string` | Meta description of the page | | `data.content[].wordCount` | `number` | Total word count of the page content | | `data.content[].automatedReadabilityIndex` | `number` | Automated Readability Index score (grade level needed to understand) | | `data.content[].colemanLiauIndex` | `number` | Coleman-Liau readability index (grade level estimate) | | `data.content[].fleschReadingEase` | `number` | Flesch Reading Ease score (higher = easier to read, 0-100) | > Extracts clean text content and computes readability metrics. --- ## "Instant Page Audit" *Source: seo-onpage/instant-pages.mdx* ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/onpage/instant', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://vercel.com/docs" }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/onpage/instant \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://vercel.com/docs"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | Full URL to audit | — | ### Response **Response:** ```json { "ok": true, "data": { "pages": [ { "description": "Next.js by Vercel is the full-stack React framework for the web.", "externalLinks": 0, "h1": ["The React Framework for the Web"], "images": 0, "internalLinks": 0, "statusCode": 200, "timeToInteractive": 144.0, "title": "Next.js by Vercel - The React Framework", "url": "https://nextjs.org/", "wordCount": 316 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.pages` | `array` | List of audited pages | | `data.pages[].url` | `string` | The URL that was audited | | `data.pages[].statusCode` | `number` | HTTP status code of the page | | `data.pages[].title` | `string` | Page title from the `` tag | | `data.pages[].description` | `string` | Meta description content | | `data.pages[].h1` | `string[]` | Array of H1 heading texts found on the page | | `data.pages[].wordCount` | `number` | Total word count of the page content | | `data.pages[].internalLinks` | `number` | Number of internal links on the page | | `data.pages[].externalLinks` | `number` | Number of external links on the page | | `data.pages[].images` | `number` | Number of images on the page | | `data.pages[].timeToInteractive` | `number` | Time to interactive in milliseconds | > Instant on-page analysis without crawling. Returns results in real-time. --- ## "Lighthouse Audit" *Source: seo-onpage/lighthouse.mdx* <Endpoint method="POST" path="/v1/seo/onpage/lighthouse" cost={0.05} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/onpage/lighthouse', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://vercel.com" }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/onpage/lighthouse \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://vercel.com"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | Full URL to audit | — | ### Response **Response:** ```json { "ok": true, "data": { "accessibilityScore": 0.96, "bestPracticesScore": 0.96, "cumulativeLayoutShift": 0.0, "firstContentfulPaint": 379.582, "largestContentfulPaint": 739.582, "performanceScore": 1.0, "seoScore": 1.0, "speedIndex": 517.72, "totalBlockingTime": 0.0, "url": "" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.performanceScore` | `number` | Lighthouse performance score (0-1) | | `data.accessibilityScore` | `number` | Lighthouse accessibility score (0-1) | | `data.bestPracticesScore` | `number` | Lighthouse best practices score (0-1) | | `data.seoScore` | `number` | Lighthouse SEO score (0-1) | | `data.firstContentfulPaint` | `number` | First Contentful Paint in milliseconds (FCP) | | `data.largestContentfulPaint` | `number` | Largest Contentful Paint in milliseconds (LCP) | | `data.cumulativeLayoutShift` | `number` | Cumulative Layout Shift score (CLS) | | `data.speedIndex` | `number` | Speed Index in milliseconds | | `data.totalBlockingTime` | `number` | Total Blocking Time in milliseconds (TBT) | | `data.url` | `string` | The URL that was audited | > Full Lighthouse audit. Scores and Core Web Vitals in one call. --- ## Google Business Data *Source: seo-other/business-info.mdx* <Endpoint method="POST" path="/v1/seo/business/info" cost={0.03} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/business/info', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keyword: 'pizza near times square', location: 'us' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/business/info \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keyword": "pizza near times square", "location": "us"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keyword` | `string` | Yes | Search query for business listings | — | | `location` | `string` | No | Country code | `"us"` | ### Response **Response:** ```json { "ok": true, "data": { "keyword": "pizza near times square", "results": [ { "name": "Joe's Pizza", "address": "7 Carmine St, New York, NY 10014", "phone": "+1-212-366-1182", "website": "https://joespizzanyc.com", "rating": 4.5, "reviewCount": 12400, "category": "Pizza restaurant", "workingHours": "Mon-Sun: 10am-4am" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.keyword` | `string` | The search query used to find businesses | | `data.results` | `array` | List of Google Business listings matching the query | | `data.results[].name` | `string` | Business name | | `data.results[].address` | `string` | Full street address of the business | | `data.results[].phone` | `string` | Business phone number | | `data.results[].website` | `string` | Business website URL | | `data.results[].rating` | `number` | Average Google rating (0-5) | | `data.results[].reviewCount` | `number` | Total number of Google reviews | | `data.results[].category` | `string` | Google Business category | | `data.results[].workingHours` | `string` | Business operating hours | > Queries Google Business listings in real-time. --- ## "Google Trends" *Source: seo-other/explore.mdx* <Endpoint method="POST" path="/v1/seo/trends" cost={0.02} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/seo/trends', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ "keywords": ["react", "vue", "svelte"], "location": "us" }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/seo/trends \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keywords":["react","vue","svelte"],"location":"us"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keywords` | `string[]` | Yes | Keywords to compare (max 5) | — | | `location` | `string` | No | Country code | `us` | ### Response **Response:** ```json { "ok": true, "data": { "keywords": ["react", "vue", "svelte"], "timeline": [ { "date": "2026-03-01", "values": [85, 22, 12] }, { "date": "2026-04-01", "values": [88, 21, 14] } ], "averages": [86, 22, 13] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.keywords` | `string[]` | The keywords that were compared | | `data.timeline` | `array` | Interest over time data points | | `data.timeline[].date` | `string` | Date of the data point | | `data.timeline[].values` | `number[]` | Interest values for each keyword (0-100, relative to peak) | | `data.averages` | `number[]` | Average interest values for each keyword over the time period | > Real-time Google Trends data. Compare up to 5 keywords over time. --- ## Baidu SERP *Source: serp-api/baidu.mdx* <Endpoint method="POST" path="/v1/serp/baidu" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/baidu', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'cloud computing services', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/baidu \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "cloud computing services", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query to look up on Baidu | — | | `depth` | `number` | No | Number of results to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "cloud computing", "totalResults": 0, "results": [] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The search query that was executed on Baidu | | `data.totalResults` | `number` | Total number of Baidu results for the query | | `data.results` | `object[]` | Array of search result items (may be empty for some queries) | | `data.results[].position` | `number` | Position in search results (1-indexed) | | `data.results[].type` | `string` | Result type (e.g., `organic`) | | `data.results[].title` | `string` | Title of the search result | | `data.results[].url` | `string` | URL of the search result page | | `data.results[].description` | `string` | Snippet or description shown in Baidu results | | `data.results[].domain` | `string` | Domain of the result URL | > Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency. --- ## Bing SERP *Source: serp-api/bing.mdx* <Endpoint method="POST" path="/v1/serp/bing" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/bing', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'typescript vs javascript performance', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/bing \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "typescript vs javascript performance", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query to look up on Bing | — | | `depth` | `number` | No | Number of results to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "typescript vs javascript", "totalResults": 50, "results": [ { "position": 1, "type": "organic", "title": "Why use triple-equal (===) in TypeScript? - Stack Overflow", "url": "https://stackoverflow.com/questions/57125700/why-use-triple-equal-in-typescript", "description": "Jul 20, 2019 · Typescript actually does fix == vs === (as far as possible at least). In Javascript there are two comparison operators: == : When comparing primitive values, like numbers and strings, this ...", "domain": "stackoverflow.com" }, { "position": 2, "type": "organic", "title": "What is TypeScript and why should I use it instead of JavaScript ...", "url": "https://stackoverflow.com/questions/12694530/what-is-typescript-and-why-should-i-use-it-instead-of-javascript", "description": "What is the TypeScript language? What can it do that JavaScript or available libraries cannot do, that would give me reason to consider it?", "domain": "stackoverflow.com" }, { "position": 3, "type": "organic", "title": "When should I use ?? (nullish coalescing) vs || (logical ...", "url": "https://stackoverflow.com/questions/61480993/when-should-i-use-nullish-coalescing-vs-logical-or", "description": "The nullish coalescing operator (??) in JavaScript only considers null or undefined as \"nullish\" values. If the left-hand side is any other value, even falsy values like \"\" (empty string), 0, or false, it will not use ...", "domain": "stackoverflow.com" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The search query that was executed on Bing | | `data.totalResults` | `number` | Total number of Bing results for the query | | `data.results` | `object[]` | Array of search result items | | `data.results[].position` | `number` | Position in search results (1-indexed) | | `data.results[].type` | `string` | Result type (typically `organic`) | | `data.results[].title` | `string` | Title of the search result | | `data.results[].url` | `string` | URL of the search result page | | `data.results[].description` | `string` | Snippet or description shown in Bing results | | `data.results[].domain` | `string` | Domain of the result URL | > Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency. --- ## Google Ads Transparency *Source: serp-api/google-ads.mdx* <Endpoint method="POST" path="/v1/serp/google-ads" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/google-ads', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'project management software', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/google-ads \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "project management software", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query to find ads in the Google Ads Transparency Center | — | | `depth` | `number` | No | Number of results to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "project management software", "totalResults": 0, "results": [] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The search query used to find ads in the Transparency Center | | `data.totalResults` | `number` | Total number of ad results found | | `data.results` | `object[]` | Array of ad result items (may be empty if no ads are found for the query) | | `data.results[].position` | `number` | Position in ad results (1-indexed) | | `data.results[].type` | `string` | Result type (e.g., `ad`, `paid`) | | `data.results[].title` | `string` | Ad headline or title | | `data.results[].url` | `string` | Destination URL of the ad | | `data.results[].description` | `string` | Ad copy or description text | | `data.results[].domain` | `string` | Advertiser domain | > Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency. --- ## Google AI Mode *Source: serp-api/google-ai-mode.mdx* <Endpoint method="POST" path="/v1/serp/google-ai-mode" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/google-ai-mode', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'what is retrieval augmented generation', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/google-ai-mode \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "what is retrieval augmented generation", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query to retrieve Google AI Mode results for | — | | `depth` | `number` | No | Number of results to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "what is retrieval augmented generation", "totalResults": 0, "results": [] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The search query that was executed in AI Mode | | `data.totalResults` | `number` | Total number of results found | | `data.results` | `object[]` | Array of AI Mode result items (may be empty if no AI-generated content is available) | | `data.results[].position` | `number` | Position in results (1-indexed) | | `data.results[].type` | `string` | Result type (e.g., `aiOverview`, `citedSource`) | | `data.results[].title` | `string` | Title of the result or cited source | | `data.results[].url` | `string` | URL of the cited source | | `data.results[].description` | `string` | AI-generated summary or source excerpt | | `data.results[].domain` | `string` | Domain of the cited source | > Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency. --- ## Google Autocomplete *Source: serp-api/google-autocomplete.mdx* <Endpoint method="POST" path="/v1/serp/google-autocomplete" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/google-autocomplete', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'how to build a', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/google-autocomplete \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "how to build a", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Partial search query to get autocomplete suggestions for | — | | `depth` | `number` | No | Number of suggestions to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "how to build a", "totalResults": 0, "results": [ { "position": 1, "type": "autocomplete", "title": "", "url": "", "description": "", "domain": "" }, { "position": 2, "type": "autocomplete", "title": "", "url": "", "description": "", "domain": "" }, { "position": 3, "type": "autocomplete", "title": "", "url": "", "description": "", "domain": "" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The partial query that was sent for autocomplete | | `data.totalResults` | `number` | Total number of suggestions returned (typically `0` as autocomplete does not report totals) | | `data.results` | `object[]` | Array of autocomplete suggestion items | | `data.results[].position` | `number` | Position of the suggestion (1-indexed) | | `data.results[].type` | `string` | Result type (typically `autocomplete`) | | `data.results[].title` | `string` | The suggested search query completion | | `data.results[].url` | `string` | URL for the suggestion (typically empty) | | `data.results[].description` | `string` | Additional context for the suggestion (typically empty) | | `data.results[].domain` | `string` | Associated domain (typically empty for autocomplete) | > Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency. --- ## Google Datasets *Source: serp-api/google-datasets.mdx* <Endpoint method="POST" path="/v1/serp/google-datasets" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/google-datasets', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'global climate temperature data', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/google-datasets \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "global climate temperature data", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Dataset search query to look up on Google Dataset Search | — | | `depth` | `number` | No | Number of results to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "global temperature data", "totalResults": 119, "results": [ { "position": 1, "type": "dataset", "title": "Global Temperature Time Series", "url": "", "description": "", "domain": "" }, { "position": 2, "type": "dataset", "title": "Global land and ocean temperature anomalies 1880-2024", "url": "", "description": "", "domain": "" }, { "position": 3, "type": "dataset", "title": "Global Temperatures by Country", "url": "", "description": "", "domain": "" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The dataset search query that was executed | | `data.totalResults` | `number` | Total number of datasets found matching the query | | `data.results` | `object[]` | Array of dataset result items | | `data.results[].position` | `number` | Position in dataset search results (1-indexed) | | `data.results[].type` | `string` | Result type (typically `dataset`) | | `data.results[].title` | `string` | Name of the dataset | | `data.results[].url` | `string` | URL to access the dataset (may be empty) | | `data.results[].description` | `string` | Description of the dataset contents (may be empty) | | `data.results[].domain` | `string` | Domain hosting the dataset (may be empty) | > Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency. --- ## Google Finance *Source: serp-api/google-finance.mdx* <Endpoint method="POST" path="/v1/serp/google-finance" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/google-finance', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'AAPL stock price', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/google-finance \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "AAPL stock price", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Finance search query to look up on Google Finance | — | | `depth` | `number` | No | Number of results to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "AAPL stock", "totalResults": 0, "results": [] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The finance search query that was executed | | `data.totalResults` | `number` | Total number of finance results found | | `data.results` | `object[]` | Array of finance result items (may be empty if no structured finance data is available) | | `data.results[].position` | `number` | Position in results (1-indexed) | | `data.results[].type` | `string` | Result type (e.g., `financeSearch`, `stockQuote`) | | `data.results[].title` | `string` | Stock ticker name or financial instrument title | | `data.results[].url` | `string` | URL to the finance page | | `data.results[].description` | `string` | Financial summary or market data snippet | | `data.results[].domain` | `string` | Domain of the finance data source | > Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency. --- ## Google Images *Source: serp-api/google-images.mdx* <Endpoint method="POST" path="/v1/serp/google-images" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/google-images', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'modern dashboard UI design', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/google-images \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "modern dashboard UI design", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Image search query to look up on Google Images | — | | `depth` | `number` | No | Number of results to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "modern dashboard UI", "totalResults": 0, "results": [ { "position": 2, "type": "imagesSearch", "title": "Modern Dashboard Design designs, themes ...", "url": "https://dribbble.com/tags/modern-dashboard-design", "description": "", "domain": "" }, { "position": 3, "type": "imagesSearch", "title": "Modern Dashboard UI Design Design ...", "url": "https://www.figma.com/community/file/1339194361793974200/modern-dashboard-ui-design-design-free", "description": "", "domain": "" }, { "position": 4, "type": "imagesSearch", "title": "Dashboard Design: best practices and ...", "url": "https://www.justinmind.com/ui-design/dashboard-design-best-practices-ux", "description": "", "domain": "" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The image search query that was executed | | `data.totalResults` | `number` | Total number of image results found (may be `0` when Google does not expose a count) | | `data.results` | `object[]` | Array of image search result items | | `data.results[].position` | `number` | Position in image search results (1-indexed) | | `data.results[].type` | `string` | Result type (e.g., `imagesSearch`, `carousel`, `relatedSearches`) | | `data.results[].title` | `string` | Title or alt text of the image result | | `data.results[].url` | `string` | URL of the page containing the image | | `data.results[].description` | `string` | Description or caption of the image (often empty for image results) | | `data.results[].domain` | `string` | Domain of the source page (may be empty for image results) | > Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency. --- ## Google Maps *Source: serp-api/google-maps.mdx* <Endpoint method="POST" path="/v1/serp/google-maps" cost={0.01} /> A live text search across Google Maps that returns rich, structured place data — sourced directly from the Google Maps Places (New) API, not a SERP scrape. Send any natural-language query (`"restaurants in chicago"`, `"24h pharmacy near london bridge"`, `"electric car chargers manhattan"`) and get back full business profiles in one call. ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/google-maps', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'restaurants in chicago', limit: 10, open_now: true, rank_by: 'relevance', }), }); const { data } = await res.json(); console.log(data.results[0]); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/google-maps \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "restaurants in chicago", "limit": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Text query, e.g. `"restaurants in chicago"`, `"coffee shops near times square"`. | — | | `limit` | `number` | No | Number of places to return (1–20). Use `nextPageToken` for more. | `10` | | `language` | `string` | No | BCP-47 language code (e.g. `en`, `es`, `fr`). | `"en"` | | `region` | `string` | No | CLDR region code (e.g. `us`, `gb`, `de`). Biases results to a country. | — | | `rank_by` | `string` | No | `"relevance"` or `"distance"`. `distance` requires `latitude` + `longitude` + `radius`. | `"relevance"` | | `open_now` | `boolean` | No | Restrict to places open at request time. | `false` | | `min_rating` | `number` | No | Minimum average star rating (0.0–5.0). | — | | `price_levels` | `string[]` | No | Filter by price tier(s). Any of `free`, `inexpensive`, `moderate`, `expensive`, `very_expensive`. | — | | `included_type` | `string` | No | Restrict to a single Google Place type (e.g. `restaurant`, `cafe`, `bar`, `gym`). | — | | `latitude` | `number` | No | Center latitude for an optional location bias circle. | — | | `longitude` | `number` | No | Center longitude for an optional location bias circle. | — | | `radius` | `number` | No | Radius in meters (1–50000). All three of `latitude`, `longitude`, `radius` must be provided together. | — | ### Response **Response:** ```json { "ok": true, "data": { "query": "restaurants in chicago", "totalResults": 1, "nextPageToken": "AU_ZVEFqNRxa-OTq...", "searchUrl": "https://www.google.com/maps/search/restaurants+in+chicago", "results": [ { "id": "ChIJs8mbNsUsDogRUnpg-b_IK5E", "name": "Girl & The Goat", "primaryType": "american_restaurant", "primaryTypeDisplay": "American Restaurant", "types": ["brunch_restaurant", "seafood_restaurant", "american_restaurant", "restaurant", "food"], "address": "809 W Randolph St, Chicago, IL 60607, USA", "shortAddress": "809 W Randolph St, Chicago", "addressComponents": { "city": "Chicago", "state": "Illinois", "country": "US", "postalCode": "60607", "neighborhood": "Fulton Market District" }, "phone": "(312) 492-6262", "internationalPhone": "+1 312-492-6262", "website": "http://www.girlandthegoat.com/", "googleMapsUrl": "https://maps.google.com/?cid=10460675286346267218", "latitude": 41.8841279, "longitude": -87.6479354, "plusCode": "86HJV9M2+MR", "rating": 4.7, "userRatingCount": 7713, "priceLevel": "expensive", "priceRange": { "min": 50, "max": 100, "currency": "USD" }, "businessStatus": "OPERATIONAL", "openNow": false, "hours": [ "Monday: 4:30 – 10:00 PM", "Tuesday: 4:30 – 10:00 PM", "Wednesday: 4:30 – 10:00 PM", "Thursday: 4:30 – 10:00 PM", "Friday: 4:30 – 11:00 PM", "Saturday: 4:00 – 11:00 PM", "Sunday: 10:00 AM – 2:00 PM, 4:30 – 10:00 PM" ], "nextOpenTime": "2026-04-22T21:30:00Z", "timezone": "America/Chicago", "summary": "Hot spot where Stephanie Izard serves up innovative small plates...", "aiSummary": "Cool eatery serving small dishes as well as familiar fare based on American recipes...", "reviewSummary": "People say this restaurant serves delicious goat empanadas, skirt steak, and great cocktails.", "iconUrl": "https://maps.gstatic.com/mapfiles/place_api/icons/v2/restaurant_pinlet.png", "iconBackgroundColor": "#FF9E67", "amenities": { "dineIn": true, "takeout": true, "delivery": false, "reservable": true, "servesDinner": true, "servesCocktails": true, "outdoorSeating": false, "goodForGroups": true }, "payments": { "acceptsCreditCards": true, "acceptsDebitCards": true, "acceptsNfc": true, "acceptsCashOnly": false }, "parking": { "paidStreetParking": true, "valetParking": true }, "accessibility": { "wheelchairAccessibleEntrance": true, "wheelchairAccessibleRestroom": true, "wheelchairAccessibleSeating": true }, "photos": [ { "reference": "places/ChIJs8mbNsUsDogRUnpg-b_IK5E/photos/AU_ZVEFd3Y9YtVSYWUZf4lYRda5p51TB2iSOLW...", "width": 1200, "height": 788, "attribution": "Girl & The Goat", "googleMapsUrl": "https://www.google.com/maps/place//data=!3m4!1e2!3m2!..." } ], "topReview": { "rating": 5, "text": "Dining at Girl & the Goat was an amazing experience for my family on Christmas!...", "author": "Jisoo Choi", "publishedAt": "2026-01-15T18:12:52Z", "relativeTime": "3 months ago" }, "directionsUrl": "https://www.google.com/maps/dir//...", "reviewsUrl": "https://www.google.com/maps/place//...", "photosUrl": "https://www.google.com/maps/place//...", "writeReviewUrl": "https://www.google.com/maps/place//..." } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `data.query` | `string` | Echo of the text query you submitted. | | `data.totalResults` | `number` | Number of places returned in this response (≤ `limit`). | | `data.nextPageToken` | `string?` | Pagination token. Include in your next request to fetch more results. | | `data.searchUrl` | `string?` | Direct Google Maps search URL for the same query. | | `data.results[].id` | `string` | Stable Google Place ID — use it to look the place up later. | | `data.results[].name` | `string` | Display name as shown on Google Maps. | | `data.results[].primaryType` | `string` | Primary place type, e.g. `american_restaurant`, `cafe`, `gym`. | | `data.results[].primaryTypeDisplay` | `string` | Human-friendly version of `primaryType` (e.g. `"American Restaurant"`). | | `data.results[].types` | `string[]` | All place categories Google associates with this place. | | `data.results[].address` | `string` | Full formatted street address. | | `data.results[].shortAddress` | `string` | Short address (street + city only). | | `data.results[].addressComponents` | `object` | Parsed `city`, `state`, `country`, `postalCode`, `neighborhood`. | | `data.results[].phone` | `string?` | National format phone number. | | `data.results[].internationalPhone` | `string?` | E.164 international format phone number. | | `data.results[].website` | `string?` | Business website URL. | | `data.results[].googleMapsUrl` | `string?` | Direct Google Maps URL for the place. | | `data.results[].latitude` / `longitude` | `number` | Geographic coordinates. | | `data.results[].plusCode` | `string?` | Open Location Code (Plus Code) global identifier. | | `data.results[].rating` | `number?` | Average star rating (0.0–5.0). | | `data.results[].userRatingCount` | `number?` | Total number of user ratings. | | `data.results[].priceLevel` | `string?` | One of `free`, `inexpensive`, `moderate`, `expensive`, `very_expensive`. | | `data.results[].priceRange` | `object?` | `{ min, max, currency }` for restaurants where Google has price data. | | `data.results[].businessStatus` | `string?` | `OPERATIONAL`, `CLOSED_TEMPORARILY`, or `CLOSED_PERMANENTLY`. | | `data.results[].openNow` | `boolean?` | Whether the place is open right now. | | `data.results[].hours` | `string[]?` | Array of 7 weekday-formatted opening hours strings. | | `data.results[].nextOpenTime` | `string?` | ISO-8601 timestamp of the next time this place will be open. | | `data.results[].timezone` | `string?` | IANA timezone (e.g. `America/Chicago`). | | `data.results[].summary` | `string?` | Editorial summary written by Google. | | `data.results[].aiSummary` | `string?` | AI-generated overview (Gemini). | | `data.results[].reviewSummary` | `string?` | AI-generated summary of recent user reviews. | | `data.results[].iconUrl` / `iconBackgroundColor` | `string?` | Google Maps category icon and tint color. | | `data.results[].amenities` | `object?` | Boolean flags: `dineIn`, `takeout`, `delivery`, `reservable`, `servesBeer`, `servesWine`, `outdoorSeating`, `liveMusic`, `goodForChildren`, `allowsDogs`, `goodForGroups`, etc. | | `data.results[].payments` | `object?` | `acceptsCreditCards`, `acceptsDebitCards`, `acceptsNfc`, `acceptsCashOnly`. | | `data.results[].parking` | `object?` | Parking flags such as `freeParkingLot`, `paidStreetParking`, `valetParking`. | | `data.results[].accessibility` | `object?` | Wheelchair accessibility flags. | | `data.results[].photos` | `object[]?` | Up to 10 place photos with `reference`, `width`, `height`, `attribution`, `googleMapsUrl`. | | `data.results[].topReview` | `object?` | Most recent featured review: `rating`, `text`, `author`, `publishedAt`, `relativeTime`. | | `data.results[].directionsUrl` / `reviewsUrl` / `photosUrl` / `writeReviewUrl` | `string?` | Deep links into Google Maps. | ### Pagination When more results exist, the response includes a `nextPageToken`. Send the same query plus the token in a follow-up request to fetch the next page. ### Pricing `$0.01` per call regardless of how many places are returned. No monthly minimums. > This endpoint queries the Google Maps Places (New) API directly (`places:searchText`). All fields are sourced from Google Maps in real time and normalized into the response shape above. --- ## Google News *Source: serp-api/google-news.mdx* <Endpoint method="POST" path="/v1/serp/google-news" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/google-news', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'artificial intelligence startups', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/google-news \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "artificial intelligence startups", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | News search query to look up on Google News | — | | `depth` | `number` | No | Number of results to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "artificial intelligence startups", "totalResults": 38000, "results": [ { "position": 1, "type": "newsSearch", "title": "Exclusive | Startup Targets New Frontier for AI: Construction Drawings", "url": "https://www.wsj.com/pro/venture-capital/startup-targets-new-frontier-for-ai-construction-drawings-cbf5b51c", "description": "", "domain": "www.wsj.com" }, { "position": 2, "type": "newsSearch", "title": "Venture firm TSVC seeks $120M for targeting physical AI", "url": "https://www.bizjournals.com/sanjose/news/2026/04/13/tsvc-fund-filing-120-million.html", "description": "", "domain": "www.bizjournals.com" }, { "position": 3, "type": "newsSearch", "title": "Chinese AI startup StepFun to unwind offshore structure to pave way for IPO, sources say", "url": "https://www.reuters.com/world/china/chinese-ai-startup-stepfun-unwind-offshore-structure-pave-way-ipo-sources-say-2026-04-13/", "description": "", "domain": "www.reuters.com" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The news search query that was executed | | `data.totalResults` | `number` | Estimated total number of news results for the query | | `data.results` | `object[]` | Array of news search result items | | `data.results[].position` | `number` | Position in news results (1-indexed) | | `data.results[].type` | `string` | Result type (typically `newsSearch`) | | `data.results[].title` | `string` | Headline of the news article | | `data.results[].url` | `string` | URL of the news article | | `data.results[].description` | `string` | Article excerpt or summary (may be empty) | | `data.results[].domain` | `string` | Publisher domain (e.g., `www.wsj.com`, `techcrunch.com`) | > Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency. --- ## Google SERP *Source: serp-api/google.mdx* <Endpoint method="POST" path="/v1/serp/google" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/google', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'best react frameworks 2026', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/google \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "best react frameworks 2026", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query to look up on Google | — | | `depth` | `number` | No | Number of results to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "pizza near me", "totalResults": 1470000000, "itemTypes": [ "paid", "localPack", "organic", "peopleAlsoAsk", "relatedSearches" ], "results": [ { "position": 1, "type": "paid", "title": "Pizza Delivery - Order Online Now", "url": "https://www.dominos.com/", "description": "Get hot, fresh pizza delivered to your door. Order online for exclusive deals.", "domain": "www.dominos.com", "data": { "breadcrumb": "https://www.dominos.com", "highlighted": ["Pizza Delivery", "Order Online"], "extra": { "type": "organic", "links": [ { "title": "Order Pizza Online", "url": "https://www.dominos.com/pages/order/" } ] }, "descriptionRows": ["Free delivery on orders over $20"] } }, { "position": 2, "type": "localPack", "title": "Joe's Pizza", "url": "", "description": "", "domain": "", "data": { "rating": { "ratingType": "Max5", "value": 4.7, "votesCount": 2341 }, "phone": "+1-212-555-0199", "address": "7 Carmine St, New York, NY 10014", "cid": "12345678901234567890", "isMapsItem": true } }, { "position": 5, "type": "organic", "title": "Best Pizza Near Me - Find Local Pizza Restaurants", "url": "https://www.yelp.com/search?find_desc=pizza", "description": "Find the best pizza near you with Yelp's comprehensive directory of local pizza restaurants, reviews, and ratings.", "domain": "www.yelp.com", "data": { "breadcrumb": "www.yelp.com > search", "websiteName": "Yelp", "isFeaturedSnippet": false, "isImage": false, "isVideo": false, "highlighted": ["pizza", "near"], "links": [ { "type": "link_element", "title": "Pizza Delivery", "url": "https://www.yelp.com/search?find_desc=pizza+delivery" } ], "rating": { "ratingType": "Max5", "value": 4.2, "votesCount": 890 } } }, { "position": 8, "type": "peopleAlsoAsk", "title": "People also ask", "url": "", "description": "", "domain": "", "data": { "items": [ { "type": "peopleAlsoAskElement", "title": "What is the best pizza chain?", "expandedElement": [ { "type": "peopleAlsoAskExpandedElement", "title": "Best Pizza Chains Ranked", "url": "https://www.example.com/best-pizza-chains", "domain": "www.example.com", "description": "According to a nationwide survey..." } ] } ] } }, { "position": 11, "type": "relatedSearches", "title": "", "url": "", "description": "", "domain": "", "data": { "items": [ "best pizza delivery near me", "pizza places open now", "cheap pizza near me" ] } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The search query that was executed | | `data.totalResults` | `number` | Estimated total number of Google results for the query | | `data.itemTypes` | `string[]` | Distinct result types present in this SERP (e.g. `["organic", "paid", "localPack"]`) | | `data.results` | `object[]` | Array of search result items | | `data.results[].position` | `number` | Position in search results (1-indexed) | | `data.results[].type` | `string` | Result type — see [Supported Result Types](#supported-result-types) below | | `data.results[].title` | `string` | Title of the search result | | `data.results[].url` | `string` | URL of the search result page | | `data.results[].description` | `string` | Snippet or meta description shown in the SERP | | `data.results[].domain` | `string` | Domain of the result URL | | `data.results[].data` | `object \| null` | Type-specific extra fields (see below for per-type details) | ### Supported Result Types Every Google SERP can contain a mix of the following result types. Each type includes type-specific fields in the `data` object. | Type | Description | | :--- | :--- | | `organic` | Standard organic search results | | `paid` | Paid search ads (Google Ads) | | `featuredSnippet` | Featured snippet / answer box at position zero | | `peopleAlsoAsk` | "People also ask" expandable questions | | `relatedSearches` | Related search queries | | `peopleAlsoSearch` | "People also search for" suggestions | | `localPack` | Local business results from Google Maps | | `knowledgeGraph` | Knowledge panel (entity info, Wikipedia, etc.) | | `video` | Video results (YouTube, etc.) | | `topStories` | Top stories / news carousel | | `images` | Image results pack | | `shopping` | Google Shopping product results | | `twitter` | Twitter/X results carousel | | `answerBox` | Direct answer box | | `events` | Event listings | | `jobs` | Job listing results | | `recipes` | Recipe results with ratings | | `topSights` | Tourist attraction results | | `scholarlyArticles` | Academic paper results | | `popularProducts` | Popular product listings | | `hotelsPack` | Hotel listings with prices | | `googleFlights` | Flight results | | `googleReviews` | Google review results | | `thirdPartyReviews` | Third-party review aggregations | | `googlePosts` | Google business posts | | `carousel` | Single carousel of results | | `multiCarousel` | Multi-row carousel | | `mentionCarousel` | Mention/brand carousel | | `app` | App install results | | `map` | Map embed results | ### Type-Specific `data` Fields Below are the key fields available in `data` for common result types. All field names use camelCase. #### `organic` | Field | Type | Description | | :--- | :--- | :--- | | `breadcrumb` | `string` | URL breadcrumb trail shown in the SERP | | `websiteName` | `string` | Display name of the website | | `isImage` | `boolean` | Whether an image thumbnail is shown | | `isVideo` | `boolean` | Whether a video thumbnail is shown | | `isFeaturedSnippet` | `boolean` | Whether this result is also a featured snippet | | `isMalicious` | `boolean` | Whether Google flagged this as potentially malicious | | `preSnippet` | `string` | Text shown before the main description | | `extendedSnippet` | `string` | Additional snippet text | | `highlighted` | `string[]` | Search terms highlighted in the snippet | | `links` | `object[]` | Sitelinks — each with `title`, `url`, `description` | | `faq` | `object[]` | FAQ items — each with `question`, `answer` | | `rating` | `object` | Star rating — `ratingType`, `value`, `votesCount`, `bestRating` | | `price` | `object` | Price info — `current`, `currency`, `displayedPrice` | | `timestamp` | `string` | Date shown in the result | | `ampVersion` | `boolean` | Whether AMP version exists | | `aboutThisResult` | `object` | "About this result" panel data | | `relatedResult` | `object[]` | Related results shown inline | #### `paid` | Field | Type | Description | | :--- | :--- | :--- | | `breadcrumb` | `string` | Display URL path | | `highlighted` | `string[]` | Highlighted terms in the ad | | `extra` | `object` | Extended ad content | | `descriptionRows` | `string[]` | Additional description lines | | `links` | `object[]` | Ad sitelinks — `title`, `url`, `description` | | `faq` | `object[]` | FAQ extensions | | `rating` | `object` | Seller rating | | `price` | `object` | Price extension data | #### `featuredSnippet` | Field | Type | Description | | :--- | :--- | :--- | | `featuredTitle` | `string` | Title of the featured content | | `images` | `object[]` | Images shown in the snippet | | `table` | `object` | Table data if the snippet contains a table | #### `peopleAlsoAsk` | Field | Type | Description | | :--- | :--- | :--- | | `items` | `object[]` | Array of questions, each with `title`, `expandedElement[]` | #### `localPack` | Field | Type | Description | | :--- | :--- | :--- | | `rating` | `object` | Business rating — `value`, `votesCount`, `ratingType` | | `phone` | `string` | Business phone number | | `address` | `string` | Business street address | | `cid` | `string` | Google Maps CID identifier | | `isMapsItem` | `boolean` | Whether this links to Google Maps | #### `knowledgeGraph` | Field | Type | Description | | :--- | :--- | :--- | | `subTitle` | `string` | Entity subtitle / category | | `cardId` | `string` | Knowledge Graph card identifier | | `items` | `object[]` | Key-value attribute items | | `images` | `object[]` | Associated images | #### `shopping` | Field | Type | Description | | :--- | :--- | :--- | | `items` | `object[]` | Product items with `title`, `price`, `source`, `url`, `rating`, `deliveryInfo` | #### `video` | Field | Type | Description | | :--- | :--- | :--- | | `items` | `object[]` | Video items with `title`, `url`, `source`, `date`, `thumbnail` | > Under the hood, this queries our advanced SERP engine. We normalize the response format, convert all field names to camelCase, and pass through all type-specific data in the `data` field. The exact fields available in `data` depend on what Google returns for a given query and result type. --- ## Yahoo SERP *Source: serp-api/yahoo.mdx* <Endpoint method="POST" path="/v1/serp/yahoo" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/yahoo', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'best laptops for developers', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/yahoo \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "best laptops for developers", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query to look up on Yahoo | — | | `depth` | `number` | No | Number of results to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "best laptops 2026", "totalResults": 0, "results": [ { "position": 1, "type": "organic", "title": "The Best Laptops We've Tested (April 2026) | PCMag", "url": "https://www.pcmag.com/picks/the-best-laptops", "description": "Apr 1, 2026 · Read on to see all our picks, compare their specs, and get down-to-earth buying advice for nailing down the best laptop for you.", "domain": "www.pcmag.com" }, { "position": 2, "type": "organic", "title": "Best Laptops 2026 - Forbes Vetted", "url": "https://www.forbes.com/sites/forbes-personal-shopper/article/best-laptop/", "description": "Apr 1, 2026 · We tested 18 models across a variety of brands to find the best laptops of 2026.", "domain": "www.forbes.com" }, { "position": 3, "type": "organic", "title": "13 Of The Best Laptops You Can Buy In 2026 - SlashGear", "url": "https://www.slashgear.com/2116777/best-laptops-buy-in-2026/", "description": "Mar 10, 2026 · We've chosen laptops for 13 unique categories, including the best budget-friendly laptop, best gaming laptop, best Chromebook, and even best repairable laptop.", "domain": "www.slashgear.com" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The search query that was executed on Yahoo | | `data.totalResults` | `number` | Total number of results found (may be `0` when Yahoo does not expose a count) | | `data.results` | `object[]` | Array of search result items | | `data.results[].position` | `number` | Position in search results (1-indexed) | | `data.results[].type` | `string` | Result type (e.g., `organic`, `paid`, `topStories`, `video`, `peopleAlsoAsk`, `shopping`, `relatedSearches`) | | `data.results[].title` | `string` | Title of the search result | | `data.results[].url` | `string` | URL of the search result page | | `data.results[].description` | `string` | Snippet or description shown in Yahoo results | | `data.results[].domain` | `string` | Domain of the result URL | > Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency. --- ## YouTube SERP *Source: serp-api/youtube.mdx* <Endpoint method="POST" path="/v1/serp/youtube" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/serp/youtube', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'nextjs tutorial for beginners', depth: 10 }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/serp/youtube \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "nextjs tutorial for beginners", "depth": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query to look up on YouTube | — | | `depth` | `number` | No | Number of results to return | `10` | | `location_code` | `number` | No | Target country code (e.g., `2840` for US). See [Location Codes](/reference/location-codes). | `2840` | | `language` | `string` | No | ISO language code (e.g., `en`, `es`) | `"en"` | ### Response **Response:** ```json { "ok": true, "data": { "query": "nextjs tutorial", "totalResults": 0, "results": [] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The search query that was executed on YouTube | | `data.totalResults` | `number` | Total number of video results found | | `data.results` | `object[]` | Array of YouTube search result items (may be empty for some queries) | | `data.results[].position` | `number` | Position in search results (1-indexed) | | `data.results[].type` | `string` | Result type (e.g., `youtubeSearch`, `video`) | | `data.results[].title` | `string` | Video title | | `data.results[].url` | `string` | URL of the YouTube video | | `data.results[].description` | `string` | Video description or snippet | | `data.results[].domain` | `string` | Domain (typically `youtube.com`) | > Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency. --- ## Challenge Videos *Source: tiktok-api/challenge-videos.mdx* <Endpoint method="POST" path="/v1/tiktok/challenge-videos" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/challenge-videos', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ challenge_id: '1677534536829953' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/challenge-videos \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"challenge_id": "1677534536829953"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `challenge_id` | `string` | Yes | TikTok challenge ID | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "20", "videos": [ { "video_id": "7356291048572839174", "description": "My entry for #dancechallenge", "create_time": 1712345678, "author": { "unique_id": "dancer_jane", "nickname": "Jane Dance", "avatar": "https://p16-sign.tiktokcdn.com/..." }, "statistics": { "play_count": 3200000, "digg_count": 245000, "comment_count": 5600, "share_count": 18000 }, "video": { "duration": 30, "cover": "https://p16-sign.tiktokcdn.com/...", "play_addr": "https://v16-webapp.tiktok.com/..." } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more results are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.videos` | `object[]` | Array of challenge video objects | | `data.videos[].video_id` | `string` | Unique TikTok video identifier | | `data.videos[].description` | `string` | Video caption text | | `data.videos[].create_time` | `number` | Unix timestamp of when the video was posted | | `data.videos[].author` | `object` | Video author information | | `data.videos[].statistics` | `object` | Engagement metrics (plays, likes, comments, shares) | | `data.videos[].video` | `object` | Video media details (duration, cover image, play URL) | Use the `cursor` value from the response to paginate through results. --- ## Challenge Info *Source: tiktok-api/challenge.mdx* <Endpoint method="POST" path="/v1/tiktok/challenge" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/challenge', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ challenge_name: 'dancechallenge' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/challenge \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"challenge_name": "dancechallenge"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `challenge_name` | `string` | Yes* | Challenge hashtag name (without #) | — | | `challenge_id` | `string` | Yes* | Challenge ID (alternative to name) | — | *Provide either `challenge_name` or `challenge_id`. ### Response **Response:** ```json { "ok": true, "data": { "challenge_id": "1677534536829953", "challenge_name": "dancechallenge", "description": "Show us your best moves! Join the dance challenge.", "video_count": 48500000, "view_count": 125000000000, "cover": "https://p16-sign.tiktokcdn.com/...", "is_commercial": false } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.challenge_id` | `string` | Unique challenge identifier | | `data.challenge_name` | `string` | Challenge hashtag name | | `data.description` | `string` | Challenge description text | | `data.video_count` | `number` | Number of videos using this challenge | | `data.view_count` | `number` | Total views across all challenge videos | | `data.cover` | `string` | Challenge cover image URL | | `data.is_commercial` | `boolean` | Whether this is a sponsored/commercial challenge | --- ## Comment Replies *Source: tiktok-api/comment-replies.mdx* <Endpoint method="POST" path="/v1/tiktok/comment-replies" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/comment-replies', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ comment_id: '7356291048572839175', video_id: '7356291048572839174', }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/comment-replies \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"comment_id": "7356291048572839175", "video_id": "7356291048572839174"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `comment_id` | `string` | Yes | ID of the parent comment | — | | `video_id` | `string` | Yes | ID of the video containing the comment | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": false, "cursor": "12", "replies": [ { "comment_id": "7356291048572839180", "text": "Thank you! I used penne", "create_time": 1712348000, "digg_count": 230, "author": { "unique_id": "chefmaria", "nickname": "Chef Maria", "avatar": "https://p16-sign.tiktokcdn.com/..." } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more replies are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.replies` | `object[]` | Array of reply objects | | `data.replies[].comment_id` | `string` | Unique reply identifier | | `data.replies[].text` | `string` | Reply text content | | `data.replies[].create_time` | `number` | Unix timestamp of when the reply was posted | | `data.replies[].digg_count` | `number` | Number of likes on the reply | | `data.replies[].author` | `object` | Reply author information | Use the `cursor` value from the response to paginate through replies. --- ## Video Comments *Source: tiktok-api/comments.mdx* <Endpoint method="POST" path="/v1/tiktok/comments" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/comments', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://www.tiktok.com/@username/video/7356291048572839174' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/comments \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://www.tiktok.com/@username/video/7356291048572839174"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | Full TikTok video URL | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "20", "total_comments": 3200, "comments": [ { "comment_id": "7356291048572839175", "text": "This recipe is amazing! Made it last night", "create_time": 1712346000, "digg_count": 4500, "reply_count": 12, "author": { "unique_id": "foodlover99", "nickname": "Food Lover", "avatar": "https://p16-sign.tiktokcdn.com/..." } }, { "comment_id": "7356291048572839176", "text": "What type of pasta did you use?", "create_time": 1712347000, "digg_count": 890, "reply_count": 3, "author": { "unique_id": "homecook_mike", "nickname": "Mike Cooks", "avatar": "https://p16-sign.tiktokcdn.com/..." } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more comments are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.total_comments` | `number` | Total number of comments on the video | | `data.comments` | `object[]` | Array of comment objects | | `data.comments[].comment_id` | `string` | Unique comment identifier | | `data.comments[].text` | `string` | Comment text content | | `data.comments[].create_time` | `number` | Unix timestamp of when the comment was posted | | `data.comments[].digg_count` | `number` | Number of likes on the comment | | `data.comments[].reply_count` | `number` | Number of replies to the comment | | `data.comments[].author` | `object` | Comment author information | Use the `cursor` value from the response to paginate through comments. --- ## Music Videos *Source: tiktok-api/music-videos.mdx* <Endpoint method="POST" path="/v1/tiktok/music-videos" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/music-videos', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ music_id: '7123456789012345678' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/music-videos \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"music_id": "7123456789012345678"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `music_id` | `string` | Yes | TikTok music/sound ID | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "20", "videos": [ { "video_id": "7356291048572839174", "description": "My take on this trending sound #fyp", "create_time": 1712345678, "author": { "unique_id": "dancer_jane", "nickname": "Jane Dance", "avatar": "https://p16-sign.tiktokcdn.com/..." }, "statistics": { "play_count": 890000, "digg_count": 67000, "comment_count": 1200 }, "video": { "duration": 30, "cover": "https://p16-sign.tiktokcdn.com/..." } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more results are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.videos` | `object[]` | Array of video objects using this sound | | `data.videos[].video_id` | `string` | Unique TikTok video identifier | | `data.videos[].description` | `string` | Video caption text | | `data.videos[].create_time` | `number` | Unix timestamp of when the video was posted | | `data.videos[].author` | `object` | Video author information | | `data.videos[].statistics` | `object` | Engagement metrics (plays, likes, comments) | | `data.videos[].video` | `object` | Video media details (duration, cover image) | Use the `cursor` value from the response to paginate through results. --- ## Music Info *Source: tiktok-api/music.mdx* <Endpoint method="POST" path="/v1/tiktok/music" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/music', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://www.tiktok.com/music/original-sound-7123456789012345678' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/music \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://www.tiktok.com/music/original-sound-7123456789012345678"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | Full TikTok music/sound URL | — | ### Response **Response:** ```json { "ok": true, "data": { "music_id": "7123456789012345678", "title": "original sound", "author": "chefmaria", "album": "", "duration": 45, "is_original": true, "cover": "https://p16-sign.tiktokcdn.com/...", "play_url": "https://sf16-ies-music.tiktokcdn.com/...", "video_count": 12500 } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.music_id` | `string` | Unique music/sound identifier | | `data.title` | `string` | Sound title | | `data.author` | `string` | Sound author or artist name | | `data.album` | `string` | Album name (if applicable) | | `data.duration` | `number` | Sound duration in seconds | | `data.is_original` | `boolean` | Whether this is an original sound (not a licensed track) | | `data.cover` | `string` | Sound cover image URL | | `data.play_url` | `string` | Audio playback URL | | `data.video_count` | `number` | Number of videos using this sound | --- ## Search Challenges *Source: tiktok-api/search-challenge.mdx* <Endpoint method="POST" path="/v1/tiktok/search-challenge" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/search-challenge', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords: 'dance' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/search-challenge \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keywords": "dance"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keywords` | `string` | Yes | Search query for challenges | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "20", "challenges": [ { "challenge_id": "1677534536829953", "challenge_name": "dancechallenge", "description": "Show us your best moves!", "video_count": 48500000, "view_count": 125000000000, "cover": "https://p16-sign.tiktokcdn.com/..." } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more results are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.challenges` | `object[]` | Array of challenge results | | `data.challenges[].challenge_id` | `string` | Unique challenge identifier | | `data.challenges[].challenge_name` | `string` | Challenge hashtag name | | `data.challenges[].description` | `string` | Challenge description | | `data.challenges[].video_count` | `number` | Number of videos using this challenge | | `data.challenges[].view_count` | `number` | Total views across all challenge videos | | `data.challenges[].cover` | `string` | Challenge cover image URL | Use the `cursor` value from the response to paginate through results. --- ## Search Photos *Source: tiktok-api/search-photo.mdx* <Endpoint method="POST" path="/v1/tiktok/search-photo" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/search-photo', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords: 'travel photography' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/search-photo \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keywords": "travel photography"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keywords` | `string` | Yes | Search query for photo posts | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "20", "photos": [ { "video_id": "7389012345678901234", "description": "Hidden gems in Bali #travel #photography", "create_time": 1712456789, "author": { "unique_id": "traveler_jake", "nickname": "Jake Travels", "avatar": "https://p16-sign.tiktokcdn.com/..." }, "images": [ "https://p16-sign.tiktokcdn.com/image1.jpg", "https://p16-sign.tiktokcdn.com/image2.jpg" ], "statistics": { "digg_count": 45000, "comment_count": 890, "share_count": 2300 } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more results are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.photos` | `object[]` | Array of photo post results | | `data.photos[].video_id` | `string` | Unique post identifier | | `data.photos[].description` | `string` | Post caption text | | `data.photos[].create_time` | `number` | Unix timestamp of when the post was created | | `data.photos[].author` | `object` | Post author information | | `data.photos[].images` | `string[]` | Array of image URLs in the photo post | | `data.photos[].statistics` | `object` | Engagement metrics (likes, comments, shares) | Use the `cursor` value from the response to paginate through results. --- ## Search Users *Source: tiktok-api/search-user.mdx* <Endpoint method="POST" path="/v1/tiktok/search-user" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/search-user', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords: 'cooking' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/search-user \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keywords": "cooking"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keywords` | `string` | Yes | Search query for users | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "20", "users": [ { "unique_id": "chefmaria", "nickname": "Chef Maria", "avatar": "https://p16-sign.tiktokcdn.com/...", "signature": "Professional chef sharing quick recipes", "follower_count": 1250000, "following_count": 342, "video_count": 487, "is_verified": true } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more results are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.users` | `object[]` | Array of user results | | `data.users[].unique_id` | `string` | User's unique handle | | `data.users[].nickname` | `string` | User's display name | | `data.users[].avatar` | `string` | Profile picture URL | | `data.users[].signature` | `string` | User bio text | | `data.users[].follower_count` | `number` | Number of followers | | `data.users[].following_count` | `number` | Number of accounts followed | | `data.users[].video_count` | `number` | Total number of videos posted | | `data.users[].is_verified` | `boolean` | Whether the user is verified | Use the `cursor` value from the response to paginate through results. --- ## TikTok Search *Source: tiktok-api/search.mdx* <Endpoint method="POST" path="/v1/tiktok/search" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/search', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ keywords: 'cooking recipes' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/search \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keywords": "cooking recipes"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `keywords` | `string` | Yes | Search query | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "20", "videos": [ { "video_id": "7356291048572839174", "description": "Easy 15-minute pasta recipe #cooking #recipes #foodtok", "create_time": 1712345678, "author": { "unique_id": "chefmaria", "nickname": "Chef Maria", "avatar": "https://p16-sign.tiktokcdn.com/..." }, "statistics": { "play_count": 2450000, "digg_count": 185000, "comment_count": 3200, "share_count": 12500 }, "video": { "duration": 45, "cover": "https://p16-sign.tiktokcdn.com/...", "play_addr": "https://v16-webapp.tiktok.com/..." } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more results are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.videos` | `object[]` | Array of video results | | `data.videos[].video_id` | `string` | Unique TikTok video identifier | | `data.videos[].description` | `string` | Video caption text | | `data.videos[].create_time` | `number` | Unix timestamp of when the video was posted | | `data.videos[].author` | `object` | Video author information | | `data.videos[].statistics` | `object` | Engagement metrics (plays, likes, comments, shares) | | `data.videos[].video` | `object` | Video media details (duration, cover image, play URL) | Use the `cursor` value from the response to paginate through results. --- ## User Favorites *Source: tiktok-api/user-favorites.mdx* <Endpoint method="POST" path="/v1/tiktok/user-favorites" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/user-favorites', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ user_id: '6842123456789012345' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/user-favorites \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"user_id": "6842123456789012345"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `user_id` | `string` | Yes | TikTok user ID (numeric) | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "1712345678", "videos": [ { "video_id": "7389012345678901234", "description": "The best chocolate cake recipe ever! #baking", "create_time": 1712456789, "author": { "unique_id": "bakingqueen", "nickname": "Baking Queen", "avatar": "https://p16-sign.tiktokcdn.com/..." }, "statistics": { "play_count": 5600000, "digg_count": 420000, "comment_count": 8900 }, "video": { "duration": 60, "cover": "https://p16-sign.tiktokcdn.com/..." } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more results are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.videos` | `object[]` | Array of favorited video objects | | `data.videos[].video_id` | `string` | Unique TikTok video identifier | | `data.videos[].description` | `string` | Video caption text | | `data.videos[].create_time` | `number` | Unix timestamp of when the video was posted | | `data.videos[].author` | `object` | Video author information | | `data.videos[].statistics` | `object` | Engagement metrics (plays, likes, comments) | | `data.videos[].video` | `object` | Video media details (duration, cover image) | Use the `cursor` value from the response to paginate through results. Note that favorites are only accessible if the user's favorites are set to public. --- ## User Followers *Source: tiktok-api/user-followers.mdx* <Endpoint method="POST" path="/v1/tiktok/user-followers" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/user-followers', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ user_id: '6842123456789012345' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/user-followers \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"user_id": "6842123456789012345"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `user_id` | `string` | Yes | TikTok user ID (numeric) | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "50", "followers": [ { "user_id": "6891234567890123456", "unique_id": "foodlover99", "nickname": "Food Lover", "avatar": "https://p16-sign.tiktokcdn.com/...", "signature": "I love cooking!", "follower_count": 1200, "is_verified": false } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more results are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.followers` | `object[]` | Array of follower user objects | | `data.followers[].user_id` | `string` | Follower's unique numeric identifier | | `data.followers[].unique_id` | `string` | Follower's unique handle | | `data.followers[].nickname` | `string` | Follower's display name | | `data.followers[].avatar` | `string` | Profile picture URL | | `data.followers[].signature` | `string` | Bio text | | `data.followers[].follower_count` | `number` | Number of followers this user has | | `data.followers[].is_verified` | `boolean` | Whether the user is verified | Use the `cursor` value from the response to paginate through results. --- ## User Following *Source: tiktok-api/user-following.mdx* <Endpoint method="POST" path="/v1/tiktok/user-following" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/user-following', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ user_id: '6842123456789012345' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/user-following \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"user_id": "6842123456789012345"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `user_id` | `string` | Yes | TikTok user ID (numeric) | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "50", "following": [ { "user_id": "6891234567890123456", "unique_id": "gordonramsay", "nickname": "Gordon Ramsay", "avatar": "https://p16-sign.tiktokcdn.com/...", "signature": "Official TikTok of Gordon Ramsay", "follower_count": 45000000, "is_verified": true } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more results are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.following` | `object[]` | Array of followed user objects | | `data.following[].user_id` | `string` | User's unique numeric identifier | | `data.following[].unique_id` | `string` | User's unique handle | | `data.following[].nickname` | `string` | User's display name | | `data.following[].avatar` | `string` | Profile picture URL | | `data.following[].signature` | `string` | Bio text | | `data.following[].follower_count` | `number` | Number of followers | | `data.following[].is_verified` | `boolean` | Whether the user is verified | Use the `cursor` value from the response to paginate through results. --- ## User Posts *Source: tiktok-api/user-posts.mdx* <Endpoint method="POST" path="/v1/tiktok/user-posts" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/user-posts', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ user_id: '6842123456789012345' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/user-posts \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"user_id": "6842123456789012345"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `user_id` | `string` | Yes | TikTok user ID (numeric) | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "1712345678", "videos": [ { "video_id": "7356291048572839174", "description": "Easy 15-minute pasta recipe #cooking #recipes", "create_time": 1712345678, "statistics": { "play_count": 2450000, "digg_count": 185000, "comment_count": 3200, "share_count": 12500 }, "video": { "duration": 45, "cover": "https://p16-sign.tiktokcdn.com/...", "play_addr": "https://v16-webapp.tiktok.com/..." } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more results are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.videos` | `object[]` | Array of video objects | | `data.videos[].video_id` | `string` | Unique TikTok video identifier | | `data.videos[].description` | `string` | Video caption text | | `data.videos[].create_time` | `number` | Unix timestamp of when the video was posted | | `data.videos[].statistics` | `object` | Engagement metrics (plays, likes, comments, shares) | | `data.videos[].video` | `object` | Video media details (duration, cover image, play URL) | Use the `cursor` value from the response to paginate through results. --- ## User Reposts *Source: tiktok-api/user-reposts.mdx* <Endpoint method="POST" path="/v1/tiktok/user-reposts" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/user-reposts', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ user_id: '6842123456789012345' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/user-reposts \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"user_id": "6842123456789012345"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `user_id` | `string` | Yes | TikTok user ID (numeric) | — | | `cursor` | `string` | No | Pagination cursor from previous response | — | | `count` | `number` | No | Number of results to return | 20 | ### Response **Response:** ```json { "ok": true, "data": { "has_more": true, "cursor": "1712345678", "videos": [ { "video_id": "7401234567890123456", "description": "This hack changed my life #lifehack", "create_time": 1712567890, "author": { "unique_id": "hackmaster", "nickname": "Hack Master", "avatar": "https://p16-sign.tiktokcdn.com/..." }, "statistics": { "play_count": 8900000, "digg_count": 650000, "comment_count": 12000 }, "video": { "duration": 30, "cover": "https://p16-sign.tiktokcdn.com/..." } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.has_more` | `boolean` | Whether more results are available | | `data.cursor` | `string` | Cursor for fetching the next page | | `data.videos` | `object[]` | Array of reposted video objects | | `data.videos[].video_id` | `string` | Unique TikTok video identifier | | `data.videos[].description` | `string` | Video caption text | | `data.videos[].create_time` | `number` | Unix timestamp of when the video was posted | | `data.videos[].author` | `object` | Original video author information | | `data.videos[].statistics` | `object` | Engagement metrics (plays, likes, comments) | | `data.videos[].video` | `object` | Video media details (duration, cover image) | Use the `cursor` value from the response to paginate through results. --- ## User Story *Source: tiktok-api/user-story.mdx* <Endpoint method="POST" path="/v1/tiktok/user-story" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/user-story', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ unique_id: 'chefmaria' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/user-story \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"unique_id": "chefmaria"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `unique_id` | `string` | Yes | TikTok username (without @) | — | ### Response **Response:** ```json { "ok": true, "data": { "user_id": "6842123456789012345", "unique_id": "chefmaria", "stories": [ { "story_id": "7412345678901234567", "create_time": 1712678901, "expire_time": 1712765301, "video": { "duration": 15, "cover": "https://p16-sign.tiktokcdn.com/...", "play_addr": "https://v16-webapp.tiktok.com/..." } } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.user_id` | `string` | User's unique numeric identifier | | `data.unique_id` | `string` | User's unique handle | | `data.stories` | `object[]` | Array of active story objects | | `data.stories[].story_id` | `string` | Unique story identifier | | `data.stories[].create_time` | `number` | Unix timestamp of when the story was posted | | `data.stories[].expire_time` | `number` | Unix timestamp of when the story expires | | `data.stories[].video` | `object` | Story media details (duration, cover, play URL) | Stories are ephemeral and typically expire after 24 hours. --- ## User Profile *Source: tiktok-api/user.mdx* <Endpoint method="POST" path="/v1/tiktok/user" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/user', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ unique_id: 'chefmaria' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/user \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"unique_id": "chefmaria"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `unique_id` | `string` | Yes | TikTok username (without @) | — | ### Response **Response:** ```json { "ok": true, "data": { "user_id": "6842123456789012345", "unique_id": "chefmaria", "nickname": "Chef Maria", "avatar": "https://p16-sign.tiktokcdn.com/...", "signature": "Professional chef sharing quick recipes. New videos daily!", "is_verified": true, "region": "US", "language": "en", "follower_count": 1250000, "following_count": 342, "heart_count": 28500000, "video_count": 487, "digg_count": 12300 } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.user_id` | `string` | Unique numeric user identifier | | `data.unique_id` | `string` | User's unique handle | | `data.nickname` | `string` | User's display name | | `data.avatar` | `string` | Profile picture URL | | `data.signature` | `string` | User bio text | | `data.is_verified` | `boolean` | Whether the user is verified | | `data.region` | `string` | User's region/country code | | `data.language` | `string` | User's language | | `data.follower_count` | `number` | Number of followers | | `data.following_count` | `number` | Number of accounts followed | | `data.heart_count` | `number` | Total likes received across all videos | | `data.video_count` | `number` | Total number of videos posted | | `data.digg_count` | `number` | Number of videos the user has liked | --- ## Video Details *Source: tiktok-api/video.mdx* <Endpoint method="POST" path="/v1/tiktok/video" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/tiktok/video', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://www.tiktok.com/@username/video/7356291048572839174' }), }); const { data } = await res.json(); console.log(data); ``` ```bash curl -X POST https://api.yepapi.com/v1/tiktok/video \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://www.tiktok.com/@username/video/7356291048572839174"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | Full TikTok video URL | — | ### Response **Response:** ```json { "ok": true, "data": { "video_id": "7356291048572839174", "description": "Easy 15-minute pasta recipe #cooking #recipes", "create_time": 1712345678, "author": { "unique_id": "chefmaria", "nickname": "Chef Maria", "avatar": "https://p16-sign.tiktokcdn.com/...", "is_verified": true }, "statistics": { "play_count": 2450000, "digg_count": 185000, "comment_count": 3200, "share_count": 12500, "collect_count": 89000 }, "video": { "duration": 45, "width": 1080, "height": 1920, "cover": "https://p16-sign.tiktokcdn.com/...", "play_addr": "https://v16-webapp.tiktok.com/...", "download_addr": "https://v16-webapp.tiktok.com/..." }, "music": { "id": "7123456789012345678", "title": "original sound", "author": "chefmaria", "cover": "https://p16-sign.tiktokcdn.com/...", "play_url": "https://sf16-ies-music.tiktokcdn.com/..." } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.video_id` | `string` | Unique TikTok video identifier | | `data.description` | `string` | Video caption text | | `data.create_time` | `number` | Unix timestamp of when the video was posted | | `data.author` | `object` | Video author information | | `data.author.unique_id` | `string` | Author's unique handle | | `data.author.nickname` | `string` | Author's display name | | `data.author.is_verified` | `boolean` | Whether the author is verified | | `data.statistics` | `object` | Engagement metrics | | `data.statistics.play_count` | `number` | Total number of plays | | `data.statistics.digg_count` | `number` | Total number of likes | | `data.statistics.comment_count` | `number` | Total number of comments | | `data.statistics.share_count` | `number` | Total number of shares | | `data.statistics.collect_count` | `number` | Total number of saves/bookmarks | | `data.video` | `object` | Video media details | | `data.video.duration` | `number` | Video duration in seconds | | `data.video.cover` | `string` | Cover image URL | | `data.video.play_addr` | `string` | Video playback URL | | `data.music` | `object` | Music/sound used in the video | --- ## AI Extraction *Source: web-scraping/ai-extract.mdx* <Endpoint method="POST" path="/v1/scrape/ai-extract" cost={0.03} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/scrape/ai-extract', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://example.com/product/123', prompt: 'Extract the product name, price, and description', }), }); const { data } = await res.json(); console.log(data.extracted); ``` ```bash curl -X POST https://api.yepapi.com/v1/scrape/ai-extract \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com/product/123", "prompt": "Extract product name, price, and description"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | URL to extract data from | — | | `prompt` | `string` | Yes | What data to extract | — | | `schema` | `object` | No | JSON Schema for structured output | — | > Pass a `schema` object for strongly typed responses. Without it, the AI will infer the best structure. ### Response **Response:** ```json { "ok": true, "data": { "url": "https://example.com/product/123", "extracted": { "productName": "Wireless Headphones Pro", "price": 149.99, "currency": "USD", "description": "Premium noise-cancelling wireless headphones with 30-hour battery life" } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.url` | `string` | The URL that was scraped | | `data.extracted` | `object` | AI-extracted structured data. Fields are determined by your `prompt` or `schema` | > This combines our scraping infrastructure with AI extraction. Perfect for building data pipelines without writing CSS selectors. --- ## Data Extraction *Source: web-scraping/data-extract.mdx* <Endpoint method="POST" path="/v1/scrape/extract" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/scrape/extract', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://news.ycombinator.com', extractRules: { titles: { selector: '.titleline > a', type: 'list' }, }, }), }); const { data } = await res.json(); console.log(data.extracted); ``` ```bash curl -X POST https://api.yepapi.com/v1/scrape/extract \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://news.ycombinator.com", "extractRules": {"titles": {"selector": ".titleline > a", "type": "list"}}}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | URL to extract data from | — | | `extractRules` | `object` | Yes | CSS/XPath extraction rules (see below) | — | ### Extract Rules Format **Simple:** `{"title": "h1"}` — extracts text content of the first `h1`. **List:** `{"items": {"selector": ".card", "type": "list"}}` — extracts all matching elements. **Nested:** Extract multiple fields from repeating elements: ```json { "articles": { "selector": ".post", "type": "list", "output": { "title": ".post-title", "link": { "selector": "a", "output": "@href" } } } } ``` **Attributes:** Use `@attr` to extract element attributes: `{"image": "img@src"}`. **XPath:** Selectors starting with `/` are treated as XPath: `{"title": "//h1"}`. ### Response **Response:** ```json { "ok": true, "data": { "url": "https://news.ycombinator.com", "extracted": { "titles": [ "Show HN: Open-source AI code editor", "The State of WebAssembly 2026", "PostgreSQL 18 Released" ] } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.url` | `string` | The URL that was scraped | | `data.extracted` | `object` | Extracted data matching your `extractRules` keys. Each key contains the result of the corresponding selector | > Pages are rendered with JavaScript enabled before extraction. CSS selectors and XPath expressions both work — use whichever you prefer. --- ## Google Search *Source: web-scraping/google-search.mdx* <Endpoint method="POST" path="/v1/search/google" cost={0.02} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/search/google', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'best web scraping api', country: 'us' }), }); const { data } = await res.json(); console.log(data.html); // Raw Google SERP HTML ``` ```bash curl -X POST https://api.yepapi.com/v1/search/google \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "best web scraping api", "numResults": 10}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query | — | | `country` | `string` | No | Country code for geo-targeted results | `"us"` | | `numResults` | `number` | No | Number of results to return | `10` | ### Response **Response:** ```json { "ok": true, "data": { "query": "best web scraping api", "html": "<!DOCTYPE html><html>...(full Google SERP HTML)...</html>" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.query` | `string` | The search query that was executed | | `data.html` | `string` | Raw Google SERP HTML. Parse this to extract organic results, featured snippets, People Also Ask, and other SERP features | > Returns the raw Google search results page HTML. Parse it to extract organic results, featured snippets, People Also Ask, ads, and any other SERP features you need. --- ## JavaScript Scrape *Source: web-scraping/js-scrape.mdx* <Endpoint method="POST" path="/v1/scrape/js" cost={0.02} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/scrape/js', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://react.dev', format: 'markdown' }), }); const { data } = await res.json(); console.log(data.content); ``` ```bash curl -X POST https://api.yepapi.com/v1/scrape/js \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://react.dev", "format": "markdown"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | URL to scrape | — | | `format` | `string` | No | Output format: `markdown`, `html`, `text` | `"markdown"` | | `waitFor` | `number` | No | Wait for JS to render (ms) | `0` | | `selector` | `string` | No | CSS selector to extract specific element | — | ### Response **Response:** ```json { "ok": true, "data": { "url": "https://react.dev", "statusCode": 200, "content": "# React\n\nThe library for web and native user interfaces...", "format": "markdown" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.url` | `string` | The URL that was scraped | | `data.statusCode` | `number` | HTTP status code returned by the target page | | `data.content` | `string` | Page content in the requested format (Markdown, HTML, or plain text) | | `data.format` | `string` | The output format used (`markdown`, `html`, or `text`) | > Uses a full headless Chrome browser with JavaScript execution enabled. Ideal for SPAs built with React, Vue, Angular, or any framework that renders content client-side. --- ## Screenshot *Source: web-scraping/screenshot.mdx* <Endpoint method="POST" path="/v1/scrape/screenshot" cost={0.02} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/scrape/screenshot', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://example.com' }), }); const { data } = await res.json(); // data.image is a base64-encoded PNG const img = Buffer.from(data.image, 'base64'); ``` ```bash curl -X POST https://api.yepapi.com/v1/scrape/screenshot \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com", "fullPage": false}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | URL to screenshot | — | | `fullPage` | `boolean` | No | Capture entire scrollable page | `false` | | `width` | `number` | No | Viewport width in pixels | `1920` | | `height` | `number` | No | Viewport height in pixels | `1080` | ### Response **Response:** ```json { "ok": true, "data": { "url": "https://example.com", "image": "iVBORw0KGgoAAAANSUhEUgAA...(base64 PNG)", "width": 1920, "height": 1080 } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.url` | `string` | The URL that was screenshotted | | `data.image` | `string` | Base64-encoded PNG image data | | `data.width` | `number` | Width of the captured screenshot in pixels | | `data.height` | `number` | Height of the captured screenshot in pixels | > The `image` field contains a base64-encoded PNG. Decode it to get the raw image bytes. For full-page screenshots, the height will reflect the actual page height. --- ## Standard Scrape *Source: web-scraping/standard-scrape.mdx* <Endpoint method="POST" path="/v1/scrape" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/scrape', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://example.com', format: 'markdown' }), }); const { data } = await res.json(); console.log(data.markdown); ``` ```bash curl -X POST https://api.yepapi.com/v1/scrape \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com", "format": "markdown"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | URL to scrape | — | | `format` | `string` | No | Output format: `markdown`, `html`, `text` | `"markdown"` | | `waitFor` | `number` | No | Wait for JS rendering (ms) | `0` | | `selector` | `string` | No | CSS selector to extract specific element | — | ### Response **Response:** ```json { "ok": true, "data": { "url": "https://example.com", "statusCode": 200, "title": "Example Domain", "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples...", "metadata": { "description": "Example Domain", "ogTitle": "Example Domain" } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.url` | `string` | The URL that was scraped | | `data.statusCode` | `number` | HTTP status code returned by the target page | | `data.title` | `string` | Page title extracted from the `<title>` tag | | `data.markdown` | `string` | Page content converted to clean Markdown | | `data.metadata` | `object` | Extracted page metadata | | `data.metadata.description` | `string` | Meta description of the page | | `data.metadata.ogTitle` | `string` | Open Graph title, if present | > Under the hood, this uses our scraping infrastructure with JS rendering enabled by default. We handle proxy rotation, CAPTCHA solving, and convert the raw HTML to clean markdown automatically. --- ## Stealth Scrape *Source: web-scraping/stealth-scrape.mdx* <Endpoint method="POST" path="/v1/scrape/stealth" cost={0.03} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/scrape/stealth', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://protected-site.com/pricing' }), }); const { data } = await res.json(); console.log(data.markdown); ``` ```bash curl -X POST https://api.yepapi.com/v1/scrape/stealth \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://protected-site.com/pricing"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | URL to scrape | — | | `format` | `string` | No | Output format: `markdown`, `html`, `text` | `"markdown"` | | `waitFor` | `number` | No | Wait for JS rendering (ms) | `2000` | | `country` | `string` | No | Proxy country code | `"us"` | ### Response **Response:** ```json { "ok": true, "data": { "url": "https://protected-site.com/pricing", "statusCode": 200, "title": "Pricing - Protected Site", "markdown": "# Pricing\n\n## Starter Plan\n$29/month...", "metadata": { "description": "View our pricing plans" } } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data` | `object` | Response payload | | `data.url` | `string` | The URL that was scraped | | `data.statusCode` | `number` | HTTP status code returned by the target page | | `data.title` | `string` | Page title extracted from the `<title>` tag | | `data.markdown` | `string` | Page content converted to clean Markdown | | `data.metadata` | `object` | Extracted page metadata | | `data.metadata.description` | `string` | Meta description of the page | > Uses a premium proxy network with residential IPs and stealth browser mode. Use this when standard scrape returns blocked or empty results. --- ## Channel About *Source: youtube-api/channel-about.mdx* <Endpoint method="POST" path="/v1/youtube/channel-about" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/channel-about', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UCAuUUnT6oDeKwE6v1NGQxug' }), }); const { data } = await res.json(); console.log(data.description, data.subscriberCount); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/channel-about \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UCAuUUnT6oDeKwE6v1NGQxug"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube channel ID | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "description": "TED is a nonprofit devoted to spreading ideas...", "country": "United States", "subscriberCount": "24.5M", "viewCount": "10B", "joinedDate": "2006-06-27", "links": [ { "title": "Official site", "url": "https://ted.com" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.description` | `string` | Full channel description text | | `data.country` | `string` | Country where the channel is based | | `data.subscriberCount` | `string` | Formatted subscriber count (e.g. `24.5M`) | | `data.viewCount` | `string` | Total channel view count (e.g. `10B`) | | `data.joinedDate` | `string` | Date the channel was created in `YYYY-MM-DD` format | | `data.links` | `object[]` | External links listed on the channel | | `data.links[].title` | `string` | Link display title (e.g. `Official site`) | | `data.links[].url` | `string` | External URL | --- ## Featured Channels *Source: youtube-api/channel-channels.mdx* <Endpoint method="POST" path="/v1/youtube/channel-channels" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/channel-channels', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UCAuUUnT6oDeKwE6v1NGQxug' }), }); const { data } = await res.json(); console.log(data.data); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/channel-channels \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UCAuUUnT6oDeKwE6v1NGQxug"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube channel ID | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "data": [ { "type": "channel", "channelId": "UCsooa4yRKGN_zEE8iknghZA", "title": "TED-Ed", "channelHandle": "@TEDEd", "subscriberCountText": "1.2M subscribers", "thumbnail": [ { "url": "https://yt3.ggpht.com/...", "width": 88, "height": 88 } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data` | `object[]` | Array of featured/related channel objects | | `data.data[].type` | `string` | Content type (typically `channel`) | | `data.data[].channelId` | `string` | Unique YouTube channel identifier | | `data.data[].title` | `string` | Channel display name | | `data.data[].channelHandle` | `string` | Channel handle (e.g. `@TEDEd`) | | `data.data[].subscriberCountText` | `string` | Formatted subscriber count (e.g. `1.2M subscribers`) | | `data.data[].thumbnail` | `object[]` | Channel avatar images | --- ## Channel Community *Source: youtube-api/channel-community.mdx* <Endpoint method="POST" path="/v1/youtube/channel-community" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/channel-community', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UCAuUUnT6oDeKwE6v1NGQxug' }), }); const { data } = await res.json(); console.log(data.data, data.continuation); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/channel-community \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UCAuUUnT6oDeKwE6v1NGQxug"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube channel ID | — | | `token` | `string` | No | Pagination token | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "meta": { "channelId": "UCAuUUnT6oDeKwE6v1NGQxug" }, "data": [ { "postId": "UgkxMy8D54...", "authorText": "TED", "contentText": "What topic should we cover next?", "likeCount": 1234, "publishedTimeText": "3 days ago", "thumbnail": [ { "url": "https://yt3.ggpht.com/...", "width": 48, "height": 48 } ] } ], "continuation": "4qmF..." } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.meta` | `object` | Channel metadata | | `data.meta.channelId` | `string` | Unique YouTube channel identifier | | `data.data` | `object[]` | Array of community post objects | | `data.data[].postId` | `string` | Unique community post identifier | | `data.data[].authorText` | `string` | Display name of the post author | | `data.data[].contentText` | `string` | Text content of the community post | | `data.data[].likeCount` | `number` | Number of likes on the post | | `data.data[].publishedTimeText` | `string` | Relative publish time (e.g. `3 days ago`) | | `data.data[].thumbnail` | `object[]` | Post attachment or author avatar images | | `data.continuation` | `string` | Token to fetch the next page of results | --- ## Channel Livestreams *Source: youtube-api/channel-livestreams.mdx* <Endpoint method="POST" path="/v1/youtube/channel-livestreams" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/channel-livestreams', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UCAuUUnT6oDeKwE6v1NGQxug' }), }); const { data } = await res.json(); console.log(data.data, data.continuation); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/channel-livestreams \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UCAuUUnT6oDeKwE6v1NGQxug"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube channel ID | — | | `sort_by` | `string` | No | Sort order | `newest` | | `token` | `string` | No | Pagination token | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "meta": { "channelId": "UCAuUUnT6oDeKwE6v1NGQxug" }, "data": [ { "type": "video", "videoId": "abc123", "title": "TED Live: Innovation Summit", "viewCountText": "250K views", "publishedTimeText": "Streamed 3 days ago", "lengthText": "2:15:30", "thumbnail": [ { "url": "https://i.ytimg.com/vi/abc123/hqdefault.jpg", "width": 168, "height": 94 } ] } ], "continuation": "4qmF..." } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.meta` | `object` | Channel metadata | | `data.meta.channelId` | `string` | Unique YouTube channel identifier | | `data.data` | `object[]` | Array of livestream video objects | | `data.data[].type` | `string` | Content type (typically `video`) | | `data.data[].videoId` | `string` | Unique YouTube video identifier | | `data.data[].title` | `string` | Livestream title as displayed on YouTube | | `data.data[].viewCountText` | `string` | Human-readable view count (e.g. `250K views`) | | `data.data[].publishedTimeText` | `string` | Relative time (e.g. `Streamed 3 days ago`) | | `data.data[].lengthText` | `string` | Stream duration in `H:MM:SS` format | | `data.data[].thumbnail` | `object[]` | Video thumbnail images at various resolutions | | `data.continuation` | `string` | Token to fetch the next page of results | --- ## Channel Playlists *Source: youtube-api/channel-playlists.mdx* <Endpoint method="POST" path="/v1/youtube/channel-playlists" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/channel-playlists', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UCAuUUnT6oDeKwE6v1NGQxug' }), }); const { data } = await res.json(); console.log(data.data, data.continuation); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/channel-playlists \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UCAuUUnT6oDeKwE6v1NGQxug"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube channel ID | — | | `token` | `string` | No | Pagination token | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "meta": { "channelId": "UCAuUUnT6oDeKwE6v1NGQxug" }, "data": [ { "type": "playlist", "playlistId": "PLrAXtmErZgO...", "title": "The Most Popular TED Talks of All Time", "videoCount": "25", "thumbnail": [ { "url": "https://i.ytimg.com/vi/abc123/hqdefault.jpg", "width": 168, "height": 94 } ] } ], "continuation": "4qmF..." } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.meta` | `object` | Channel metadata | | `data.meta.channelId` | `string` | Unique YouTube channel identifier | | `data.data` | `object[]` | Array of playlist objects | | `data.data[].type` | `string` | Content type (typically `playlist`) | | `data.data[].playlistId` | `string` | Unique YouTube playlist identifier | | `data.data[].title` | `string` | Playlist title | | `data.data[].videoCount` | `string` | Number of videos in the playlist | | `data.data[].thumbnail` | `object[]` | Playlist cover thumbnail images | | `data.continuation` | `string` | Token to fetch the next page of results | --- ## Channel Search *Source: youtube-api/channel-search.mdx* <Endpoint method="POST" path="/v1/youtube/channel-search" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/channel-search', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UCAuUUnT6oDeKwE6v1NGQxug', query: 'artificial intelligence' }), }); const { data } = await res.json(); console.log(data.data, data.continuation); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/channel-search \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UCAuUUnT6oDeKwE6v1NGQxug", "query": "artificial intelligence"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube channel ID | — | | `query` | `string` | Yes | Search query | — | | `token` | `string` | No | Pagination token | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "data": [ { "type": "video", "videoId": "abc123", "title": "The future of artificial intelligence", "viewCountText": "2.3M views", "publishedTimeText": "1 year ago", "lengthText": "18:05", "thumbnail": [ { "url": "https://i.ytimg.com/vi/abc123/hqdefault.jpg", "width": 168, "height": 94 } ] } ], "continuation": "4qmF..." } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data` | `object[]` | Array of search result objects within the channel | | `data.data[].type` | `string` | Content type (typically `video`) | | `data.data[].videoId` | `string` | Unique YouTube video identifier | | `data.data[].title` | `string` | Video title as displayed on YouTube | | `data.data[].viewCountText` | `string` | Human-readable view count (e.g. `2.3M views`) | | `data.data[].publishedTimeText` | `string` | Relative publish time (e.g. `1 year ago`) | | `data.data[].lengthText` | `string` | Video duration in `H:MM:SS` or `MM:SS` format | | `data.data[].thumbnail` | `object[]` | Video thumbnail images at various resolutions | | `data.continuation` | `string` | Token to fetch the next page of results | --- ## Channel Shorts *Source: youtube-api/channel-shorts.mdx* <Endpoint method="POST" path="/v1/youtube/channel-shorts" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/channel-shorts', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UCAuUUnT6oDeKwE6v1NGQxug' }), }); const { data } = await res.json(); console.log(data.data, data.continuation); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/channel-shorts \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UCAuUUnT6oDeKwE6v1NGQxug"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube channel ID | — | | `sort_by` | `string` | No | Sort order | — | | `token` | `string` | No | Pagination token | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "meta": { "channelId": "UCAuUUnT6oDeKwE6v1NGQxug" }, "data": [ { "type": "shorts", "videoId": "abc123", "title": "Quick Tip: Public Speaking", "viewCountText": "5M views", "thumbnail": [ { "url": "https://i.ytimg.com/vi/abc123/hqdefault.jpg", "width": 168, "height": 94 } ] } ], "continuation": "4qmF..." } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.meta` | `object` | Channel metadata | | `data.meta.channelId` | `string` | Unique YouTube channel identifier | | `data.data` | `object[]` | Array of Shorts objects | | `data.data[].type` | `string` | Content type (typically `shorts`) | | `data.data[].videoId` | `string` | Unique YouTube video/Short identifier | | `data.data[].title` | `string` | Short title as displayed on YouTube | | `data.data[].viewCountText` | `string` | Human-readable view count (e.g. `5M views`) | | `data.data[].thumbnail` | `object[]` | Thumbnail images at various resolutions | | `data.continuation` | `string` | Token to fetch the next page of results | --- ## Channel Store *Source: youtube-api/channel-store.mdx* <Endpoint method="POST" path="/v1/youtube/channel-store" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/channel-store', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UCAuUUnT6oDeKwE6v1NGQxug' }), }); const { data } = await res.json(); console.log(data.data); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/channel-store \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UCAuUUnT6oDeKwE6v1NGQxug"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube channel ID | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "data": [ { "title": "Official Merch", "price": "$24.99", "url": "https://store.example.com/item", "thumbnail": [ { "url": "https://...", "width": 168, "height": 94 } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data` | `object[]` | Array of merchandise/store items | | `data.data[].title` | `string` | Product or merchandise name | | `data.data[].price` | `string` | Product price with currency symbol (e.g. `$24.99`) | | `data.data[].url` | `string` | Link to the product page | | `data.data[].thumbnail` | `object[]` | Product images | --- ## Channel Videos *Source: youtube-api/channel-videos.mdx* <Endpoint method="POST" path="/v1/youtube/channel-videos" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/channel-videos', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UCAuUUnT6oDeKwE6v1NGQxug', sort_by: 'newest' }), }); const { data } = await res.json(); console.log(data.data, data.continuation); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/channel-videos \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UCAuUUnT6oDeKwE6v1NGQxug", "sort_by": "newest"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube channel ID | — | | `sort_by` | `string` | No | Sort order | `newest` | | `token` | `string` | No | Pagination token | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "meta": { "channelId": "UCAuUUnT6oDeKwE6v1NGQxug", "title": "TED" }, "data": [ { "type": "video", "videoId": "abc123", "title": "The most important talk of the year", "viewCount": "1200000", "viewCountText": "1.2M views", "publishedTimeText": "2 weeks ago", "lengthText": "15:42", "thumbnail": [ { "url": "https://i.ytimg.com/vi/abc123/hqdefault.jpg", "width": 168, "height": 94 } ] } ], "continuation": "4qmF..." } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.meta` | `object` | Channel metadata | | `data.meta.channelId` | `string` | Unique YouTube channel identifier | | `data.meta.title` | `string` | Channel display name | | `data.data` | `object[]` | Array of video objects | | `data.data[].type` | `string` | Content type (typically `video`) | | `data.data[].videoId` | `string` | Unique YouTube video identifier | | `data.data[].title` | `string` | Video title as displayed on YouTube | | `data.data[].viewCount` | `string` | Raw view count as a numeric string | | `data.data[].viewCountText` | `string` | Human-readable view count (e.g. `1.2M views`) | | `data.data[].publishedTimeText` | `string` | Relative publish time (e.g. `2 weeks ago`) | | `data.data[].lengthText` | `string` | Video duration in `H:MM:SS` or `MM:SS` format | | `data.data[].thumbnail` | `object[]` | Video thumbnail images at various resolutions | | `data.continuation` | `string` | Token to fetch the next page of results | --- ## Channel Home *Source: youtube-api/channel.mdx* <Endpoint method="POST" path="/v1/youtube/channel" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/channel', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UCAuUUnT6oDeKwE6v1NGQxug' }), }); const { data } = await res.json(); console.log(data.meta.title, data.data); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/channel \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UCAuUUnT6oDeKwE6v1NGQxug"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube channel ID | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "meta": { "title": "Google for Developers", "channelId": "UC_x5XG1OV2P6uZZ5FSM9Ttw", "channelHandle": "@GoogleDevelopers", "description": "Subscribe to join a community of creative developers and learn the latest in Google technology...", "subscriberCount": 2620000, "subscriberCountText": "2.62M", "videosCount": 6300, "videosCountText": "6.3K videos", "isFamilySafe": true, "isUnlisted": false, "tabs": ["Home", "Videos", "Shorts", "Live", "Courses", "Playlists", "Posts", "Search"], "avatar": [{ "url": "https://yt3.ggpht.com/...", "width": 48, "height": 48 }], "banner": [{ "url": "https://yt3.ggpht.com/...", "width": 1060, "height": 175 }] }, "data": [ { "type": "player", "videoId": "bc5X2iVyJc0", "title": "Add Gemini Live agents to your video conferencing with Fishjam", "description": "Adrian from Software Mansion walks through how to connect...", "viewCount": "3174", "publishedTimeText": "5 days ago" }, { "type": "video_listing", "title": "AI Tools & Innovations", "data": [ { "type": "video", "videoId": "zEMXCoqJodE", "title": "AI coding with Gemini CLI", "lengthText": "38:29", "viewCount": "40532" } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.meta` | `object` | Channel metadata | | `data.meta.title` | `string` | Channel display name | | `data.meta.channelId` | `string` | Unique YouTube channel identifier | | `data.meta.channelHandle` | `string` | Channel handle (e.g. `@GoogleDevelopers`) | | `data.meta.description` | `string` | Channel description text | | `data.meta.subscriberCount` | `number` | Subscriber count as a number | | `data.meta.subscriberCountText` | `string` | Formatted subscriber count (e.g. `2.62M`) | | `data.meta.videosCount` | `number` | Total number of videos on the channel | | `data.meta.videosCountText` | `string` | Formatted video count (e.g. `6.3K videos`) | | `data.meta.isFamilySafe` | `boolean` | Whether the channel is marked as family-safe | | `data.meta.tabs` | `string[]` | Available channel tabs (e.g. `Home`, `Videos`, `Shorts`) | | `data.meta.avatar` | `object[]` | Channel profile picture at various sizes | | `data.meta.banner` | `object[]` | Channel banner images at various sizes | | `data.data` | `object[]` | Channel homepage content sections | | `data.data[].type` | `string` | Section type: `player`, `video_listing`, `shorts_listing` | | `data.data[].title` | `string` | Section or video title | | `data.data[].videoId` | `string` | Video identifier (for `player` type) | | `data.data[].data` | `object[]` | Nested video items (for `video_listing` type) | --- ## Video Comments *Source: youtube-api/comments.mdx* <Endpoint method="POST" path="/v1/youtube/comments" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/comments', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'dQw4w9WgXcQ' }), }); const { data } = await res.json(); console.log(data.commentsCount, data.data); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/comments \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "dQw4w9WgXcQ"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube video ID | — | | `sort` | `string` | No | Sort: `top` or `new` | `top` | | `token` | `string` | No | Continuation token for pagination | — | ### Response **Response:** ```json { "ok": true, "data": { "commentsCount": "2433931", "continuation": "Eg0SC...", "data": [ { "commentId": "Ugzge340dBgB75hWBm54AaABAg", "authorText": "@YouTube", "authorChannelId": "UCBR8-60-B28hp2BmDPdntcQ", "authorIsChannelOwner": false, "authorThumbnail": [ { "url": "https://yt3.ggpht.com/...=s88-c-k-c0x00ffffff-no-rj", "width": 88, "height": 88 } ], "textDisplay": "can confirm: he never gave us up", "likesCount": "223K", "replyCount": "961", "publishDate": "2025-05-13", "publishedAt": "2025-05-13T00:00:00Z", "publishedTimeText": "11 months ago", "replyToken": "Eg0SC...", "isVerified": true, "isArtist": false, "isCreator": false }, { "commentId": "UgxIOV-sXAchpKX94cB4AaABAg", "authorText": "@ochkalov", "authorChannelId": "UCtbyFPryy7J4DR4xh5CRCvA", "authorIsChannelOwner": false, "textDisplay": "1987 : normal song \r\n2026 : national anthem of the universe", "likesCount": "126K", "replyCount": "933", "publishDate": "2020-04-13", "publishedAt": "2020-04-13T00:00:00Z", "publishedTimeText": "6 years ago (edited)", "isVerified": false } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.commentsCount` | `string` | Total number of comments on the video | | `data.continuation` | `string` | Token to fetch the next page of comments | | `data.data` | `object[]` | Array of comment objects | | `data.data[].commentId` | `string` | Unique identifier for the comment | | `data.data[].authorText` | `string` | Comment author's display name or handle | | `data.data[].authorChannelId` | `string` | Channel ID of the comment author | | `data.data[].authorIsChannelOwner` | `boolean` | Whether the author is the video's channel owner | | `data.data[].authorThumbnail` | `object[]` | Author's profile picture images | | `data.data[].textDisplay` | `string` | Comment text content with formatting | | `data.data[].likesCount` | `string` | Human-readable like count (e.g. `223K`) | | `data.data[].replyCount` | `string` | Number of replies to this comment | | `data.data[].publishDate` | `string` | Comment date in `YYYY-MM-DD` format | | `data.data[].publishedAt` | `string` | Comment date as ISO 8601 timestamp | | `data.data[].publishedTimeText` | `string` | Relative time (e.g. `11 months ago`, `6 years ago (edited)`) | | `data.data[].replyToken` | `string` | Token to fetch replies for this comment | | `data.data[].isVerified` | `boolean` | Whether the commenter has a verified badge | | `data.data[].isArtist` | `boolean` | Whether the commenter is an Official Artist | | `data.data[].isCreator` | `boolean` | Whether the commenter is the video creator | Use the `continuation` token to paginate through comments. --- ## Hashtag Videos *Source: youtube-api/hashtag.mdx* <Endpoint method="POST" path="/v1/youtube/hashtag" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/hashtag', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ tag: 'programming' }), }); const { data } = await res.json(); console.log(data.meta, data.data); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/hashtag \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"tag": "programming"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `tag` | `string` | Yes | Hashtag (without #) | — | | `token` | `string` | No | Continuation token for pagination | — | ### Response **Response:** ```json { "ok": true, "data": { "meta": { "hashtag": "#programming", "hashtagInfoText": "1.5M videos \u00b7 253K channels" }, "continuation": "4qmF...", "data": [ { "type": "video", "videoId": "naNcmnKskUE", "title": "Programming Basics Explained", "channelTitle": "Programming with Mosh", "channelId": "UCWv7vMbMWH4-V0ZXdmDpPBA", "channelHandle": "@programmingwithmosh", "channelBadges": ["Verified"], "isVerifiedChannel": true, "description": "", "viewCount": "500000", "viewCountText": "500K views", "publishDate": "2026-01-13", "publishedAt": "2026-01-13T00:00:00Z", "publishedTimeText": "3 months ago", "lengthText": "11:31", "thumbnail": [ { "url": "https://i.ytimg.com/vi/naNcmnKskUE/hqdefault.jpg", "width": 168, "height": 94 } ], "richThumbnail": [ { "url": "https://i.ytimg.com/an_webp/naNcmnKskUE/mqdefault_6s.webp", "width": 320, "height": 180 } ], "channelThumbnail": [ { "url": "https://yt3.ggpht.com/...=s68-c-k-c0x00ffffff-no-rj", "width": 68, "height": 68 } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.meta` | `object` | Metadata about the hashtag | | `data.meta.hashtag` | `string` | The hashtag including the `#` prefix | | `data.meta.hashtagInfoText` | `string` | Summary of total videos and channels for this hashtag | | `data.continuation` | `string` | Token to fetch the next page of results | | `data.data` | `object[]` | Array of video results for this hashtag | | `data.data[].type` | `string` | Content type (typically `video`) | | `data.data[].videoId` | `string` | Unique YouTube video identifier | | `data.data[].title` | `string` | Video title as displayed on YouTube | | `data.data[].channelTitle` | `string` | Name of the channel that uploaded the video | | `data.data[].channelId` | `string` | Unique identifier for the channel | | `data.data[].channelHandle` | `string` | Channel handle (e.g. `@programmingwithmosh`) | | `data.data[].channelBadges` | `string[]` | Channel verification badges | | `data.data[].isVerifiedChannel` | `boolean` | Whether the channel is verified | | `data.data[].description` | `string` | Video description snippet | | `data.data[].viewCount` | `string` | Raw view count as a numeric string | | `data.data[].viewCountText` | `string` | Human-readable view count (e.g. `500K views`) | | `data.data[].publishDate` | `string` | Publish date in `YYYY-MM-DD` format | | `data.data[].publishedAt` | `string` | Publish date as ISO 8601 timestamp | | `data.data[].publishedTimeText` | `string` | Relative publish time (e.g. `3 months ago`) | | `data.data[].lengthText` | `string` | Video duration in `H:MM:SS` or `MM:SS` format | | `data.data[].thumbnail` | `object[]` | Video thumbnail images at various resolutions | | `data.data[].richThumbnail` | `object[]` | Animated preview thumbnail (webp format) | | `data.data[].channelThumbnail` | `object[]` | Channel avatar images | --- ## Home Feed *Source: youtube-api/home.mdx* <Endpoint method="POST" path="/v1/youtube/home" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/home', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ geo: 'US' }), }); const { data } = await res.json(); console.log(data.data); // array of recommended videos ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/home \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"geo": "US"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `geo` | `string` | No | Country code (e.g. `US`) | — | | `lang` | `string` | No | Language code (e.g. `en`) | — | | `token` | `string` | No | Continuation token for pagination | — | ### Response **Response:** ```json { "ok": true, "data": { "filters": [ { "filter": "All" }, { "filter": "Music", "continuation": "4qmF..." }, { "filter": "News", "continuation": "4qmF..." } ], "continuation": "4qmF...", "data": [ { "type": "video", "videoId": "LhpZJwUboeI", "title": "Samay Raina - STILL ALIVE (Full Special)", "channelTitle": "Samay Raina", "channelId": "UCAov2BBv1ZJav0c_yHEciAw", "channelHandle": "@SamayRainaOfficial", "description": "", "viewCountText": "46M views", "publishDate": "2026-04-07", "publishedAt": "2026-04-07T00:00:00Z", "publishedTimeText": "6 days ago" }, { "type": "shorts_listing", "data": [ { "videoId": "...", "title": "Short Title", "viewCountText": "1.2M views" } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.filters` | `object[]` | Available content category filters (e.g. All, Music, News, Gaming) | | `data.filters[].filter` | `string` | Filter label | | `data.filters[].continuation` | `string` | Token to fetch results for this specific filter | | `data.continuation` | `string` | Token to fetch the next page of results | | `data.data` | `object[]` | Mixed array of videos, shorts listings, and video listings | | `data.data[].type` | `string` | Content type: `video`, `shorts_listing`, `video_listing`, or `ad` | | `data.data[].videoId` | `string` | Unique YouTube video identifier (for `video` type) | | `data.data[].title` | `string` | Video title as displayed on YouTube | | `data.data[].channelTitle` | `string` | Name of the channel that uploaded the video | | `data.data[].channelId` | `string` | Unique identifier for the channel | | `data.data[].channelHandle` | `string` | Channel handle (e.g. `@SamayRainaOfficial`) | | `data.data[].viewCountText` | `string` | Human-readable view count (e.g. `46M views`) | | `data.data[].publishDate` | `string` | Publish date in `YYYY-MM-DD` format | | `data.data[].publishedAt` | `string` | Publish date as ISO 8601 timestamp | | `data.data[].publishedTimeText` | `string` | Relative publish time (e.g. `6 days ago`) | | `data.data[].description` | `string` | Video description snippet | --- ## YouTube Hype *Source: youtube-api/hype.mdx* <Endpoint method="POST" path="/v1/youtube/hype" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/hype', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ geo: 'US' }), }); const { data } = await res.json(); console.log(data.filters, data.data); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/hype \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"geo": "US"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `geo` | `string` | No | Country code | `US` | | `lang` | `string` | No | Language code | — | | `token` | `string` | No | Pagination token | — | ### Response **Response:** ```json { "ok": true, "data": { "data": [ { "type": "video", "videoId": "jNM0fCbU7mU", "title": "Street Catz (Pilot)", "channelTitle": "GameBoyCat", "hypeText": "#1 hyped", "lengthText": "6:11", "thumbnail": [ { "url": "https://i.ytimg.com/vi_webp/jNM0fCbU7mU/mqdefault.webp", "width": 320, "height": 180 } ] }, { "type": "video", "videoId": "X6dUhg44Ph0", "title": "Criminal Ties | Season 1 - Ep. 9", "channelTitle": "drikathebaby", "hypeText": "#2 hyped", "lengthText": "59:10", "thumbnail": [ { "url": "https://i.ytimg.com/vi_webp/X6dUhg44Ph0/mqdefault.webp", "width": 320, "height": 180 } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data` | `object[]` | Array of hyped video results ordered by rank | | `data.data[].type` | `string` | Content type (typically `video`) | | `data.data[].videoId` | `string` | Unique YouTube video identifier | | `data.data[].title` | `string` | Video title as displayed on YouTube | | `data.data[].channelTitle` | `string` | Name of the channel that uploaded the video | | `data.data[].hypeText` | `string` | Hype ranking position (e.g. `#1 hyped`, `#2 hyped`) | | `data.data[].lengthText` | `string` | Video duration in `H:MM:SS` or `MM:SS` format | | `data.data[].thumbnail` | `object[]` | Video thumbnail images at various resolutions | --- ## YouTube Metadata *Source: youtube-api/metadata.mdx* <Endpoint method="POST" path="/v1/youtube/metadata" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/metadata', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'dQw4w9WgXcQ' }), }); const { data } = await res.json(); console.log(data.viewCount, data.likeCount); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/metadata \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "dQw4w9WgXcQ"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube video ID | — | ### Response **Response:** ```json { "ok": true, "data": { "id": "dQw4w9WgXcQ", "viewCount": "1762287921", "viewCountText": "1,762,287,921 views", "likeCount": 18936262, "likeCountText": "18M" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.id` | `string` | YouTube video identifier | | `data.viewCount` | `string` | Exact total view count as a numeric string | | `data.viewCountText` | `string` | Formatted view count with commas (e.g. `1,762,287,921 views`) | | `data.likeCount` | `number` | Exact total number of likes | | `data.likeCountText` | `string` | Abbreviated like count (e.g. `18M`) | --- ## Playlist *Source: youtube-api/playlist.mdx* <Endpoint method="POST" path="/v1/youtube/playlist" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/playlist', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf' }), }); const { data } = await res.json(); console.log(data.meta, data.data); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/playlist \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube playlist ID | — | | `token` | `string` | No | Continuation token for pagination | — | ### Response **Response:** ```json { "ok": true, "data": { "meta": { "playlistId": "PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH", "title": "Coding Challenges", "channelTitle": "The Coding Train", "channelId": "UCvjgXvBlbQiydffZU7m1_aw", "channelHandle": "@TheCodingTrain", "description": "Is it the gravy train or a train wreck? Watch me take on some viewer submitted coding projects!", "videoCount": 245, "videoCountText": "245 videos", "viewCount": 2704837, "viewCountText": "2,704,837 views", "lastUpdated": "Last updated on Aug 18, 2024" }, "continuation": "4qmF...", "data": [ { "videoId": "17WoOqgXsRM", "title": "Coding Challenge 1: Starfield Simulation", "channelTitle": "The Coding Train", "channelId": "UCvjgXvBlbQiydffZU7m1_aw", "channelHandle": "@TheCodingTrain", "index": "1", "isPlayable": true, "lengthSeconds": "834", "lengthText": "13:54", "viewCount": 1300000, "viewCountText": "1.3M views", "videoInfo": "1.3M views \u2022 10 years ago", "publishDate": "2016-04-13", "publishedAt": "2016-04-13T00:00:00Z", "publishedTimeText": "10 years ago", "thumbnail": [ { "url": "https://i.ytimg.com/vi/17WoOqgXsRM/hqdefault.jpg", "width": 168, "height": 94 } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.meta` | `object` | Playlist metadata | | `data.meta.playlistId` | `string` | Unique YouTube playlist identifier | | `data.meta.title` | `string` | Playlist title | | `data.meta.channelTitle` | `string` | Name of the channel that created the playlist | | `data.meta.channelId` | `string` | Channel ID of the playlist creator | | `data.meta.channelHandle` | `string` | Channel handle (e.g. `@TheCodingTrain`) | | `data.meta.description` | `string` | Playlist description text | | `data.meta.videoCount` | `number` | Total number of videos in the playlist | | `data.meta.videoCountText` | `string` | Formatted video count (e.g. `245 videos`) | | `data.meta.viewCount` | `number` | Total view count across all playlist videos | | `data.meta.viewCountText` | `string` | Formatted view count (e.g. `2,704,837 views`) | | `data.meta.lastUpdated` | `string` | When the playlist was last updated | | `data.continuation` | `string` | Token to fetch the next page of playlist videos | | `data.data` | `object[]` | Array of playlist video objects | | `data.data[].videoId` | `string` | Unique YouTube video identifier | | `data.data[].title` | `string` | Video title as displayed on YouTube | | `data.data[].channelTitle` | `string` | Name of the video's channel | | `data.data[].channelId` | `string` | Channel ID of the video uploader | | `data.data[].index` | `string` | Position of the video within the playlist | | `data.data[].isPlayable` | `boolean` | Whether the video is currently playable | | `data.data[].lengthSeconds` | `string` | Video duration in seconds | | `data.data[].lengthText` | `string` | Video duration in `H:MM:SS` or `MM:SS` format | | `data.data[].viewCount` | `number` | Total view count for this video | | `data.data[].viewCountText` | `string` | Formatted view count (e.g. `1.3M views`) | | `data.data[].videoInfo` | `string` | Combined view count and publish time (e.g. `1.3M views * 10 years ago`) | | `data.data[].publishDate` | `string` | Publish date in `YYYY-MM-DD` format | | `data.data[].publishedAt` | `string` | Publish date as ISO 8601 timestamp | | `data.data[].publishedTimeText` | `string` | Relative publish time (e.g. `10 years ago`) | | `data.data[].thumbnail` | `object[]` | Video thumbnail images at various resolutions | Use the `continuation` token from the response to paginate through large playlists. --- ## Post Comments *Source: youtube-api/post-comments.mdx* <Endpoint method="POST" path="/v1/youtube/post-comments" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/post-comments', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UgkxMy8D54...' }), }); const { data } = await res.json(); console.log(data.data, data.continuation); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/post-comments \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UgkxMy8D54..."}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube post ID | — | | `sort` | `string` | No | Sort order | `top` | | `token` | `string` | No | Pagination token | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "data": [ { "commentId": "Ugxyz...", "authorText": "@User123", "authorChannelId": "UCxyz...", "authorThumbnail": [ { "url": "https://yt3.ggpht.com/...", "width": 88, "height": 88 } ], "textDisplay": "Great idea!", "likesCount": "42", "replyCount": "3", "publishedTimeText": "1 day ago" } ], "continuation": "4qmF..." } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data` | `object[]` | Array of comment objects on the post | | `data.data[].commentId` | `string` | Unique identifier for the comment | | `data.data[].authorText` | `string` | Comment author's display name or handle | | `data.data[].authorChannelId` | `string` | Channel ID of the comment author | | `data.data[].authorThumbnail` | `object[]` | Author's profile picture images | | `data.data[].textDisplay` | `string` | Comment text content | | `data.data[].likesCount` | `string` | Human-readable like count | | `data.data[].replyCount` | `string` | Number of replies to this comment | | `data.data[].publishedTimeText` | `string` | Relative publish time (e.g. `1 day ago`) | | `data.continuation` | `string` | Token to fetch the next page of comments | --- ## Community Post *Source: youtube-api/post.mdx* <Endpoint method="POST" path="/v1/youtube/post" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/post', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'UgkxMy8D54...' }), }); const { data } = await res.json(); console.log(data.contentText, data.likeCount); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/post \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "UgkxMy8D54..."}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube post ID | — | ### Response **Response:** ```json { "ok": true, "data": { "postId": "UgkxMy8D54...", "channelTitle": "Creator", "channelId": "UCxyz...", "contentText": "What video should I make next?", "likeCount": 5432, "replyCount": 890, "publishedTimeText": "2 days ago", "thumbnail": [ { "url": "https://yt3.ggpht.com/...", "width": 48, "height": 48 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.postId` | `string` | Unique community post identifier | | `data.channelTitle` | `string` | Name of the channel that created the post | | `data.channelId` | `string` | Unique identifier for the channel | | `data.contentText` | `string` | Text content of the community post | | `data.likeCount` | `number` | Number of likes on the post | | `data.replyCount` | `number` | Number of replies/comments on the post | | `data.publishedTimeText` | `string` | Relative publish time (e.g. `2 days ago`) | | `data.thumbnail` | `object[]` | Post image or attachment thumbnails | --- ## Related Videos *Source: youtube-api/related.mdx* <Endpoint method="POST" path="/v1/youtube/related" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/related', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'dQw4w9WgXcQ' }), }); const { data } = await res.json(); console.log(data.data); // array of related videos ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/related \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "dQw4w9WgXcQ"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube video ID | — | | `token` | `string` | No | Continuation token for pagination | — | ### Response **Response:** ```json { "ok": true, "data": { "meta": { "videoId": "dQw4w9WgXcQ", "title": "Rick Astley - Never Gonna Give You Up", "viewCount": "1756095483", "channelTitle": "Rick Astley" }, "data": [ { "type": "video", "videoId": "abc123", "title": "Related Video Title", "channelTitle": "Channel Name", "viewCount": "5000000", "lengthText": "4:12" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.meta` | `object` | Metadata about the source video | | `data.meta.videoId` | `string` | YouTube video ID of the source video | | `data.meta.title` | `string` | Title of the source video | | `data.meta.viewCount` | `string` | Total view count of the source video | | `data.meta.channelTitle` | `string` | Channel name of the source video | | `data.data` | `object[]` | Array of related video results | | `data.data[].type` | `string` | Content type (e.g., `video`) | | `data.data[].videoId` | `string` | YouTube video ID of the related video | | `data.data[].title` | `string` | Title of the related video | | `data.data[].channelTitle` | `string` | Channel name of the related video | | `data.data[].viewCount` | `string` | View count of the related video | | `data.data[].lengthText` | `string` | Video duration in human-readable format | --- ## URL Resolver *Source: youtube-api/resolve.mdx* <Endpoint method="POST" path="/v1/youtube/resolve" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/resolve', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' }), }); const { data } = await res.json(); console.log(data.videoId); // "dQw4w9WgXcQ" ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/resolve \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `url` | `string` | Yes | Any YouTube URL | — | ### Response **Response:** ```json { "ok": true, "data": { "videoId": "dQw4w9WgXcQ", "webPageType": "WEB_PAGE_TYPE_WATCH" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.videoId` | `string` | Resolved YouTube video ID (present for video URLs) | | `data.channelId` | `string` | Resolved YouTube channel ID (present for channel URLs) | | `data.playlistId` | `string` | Resolved YouTube playlist ID (present for playlist URLs) | | `data.webPageType` | `string` | Page type: `WEB_PAGE_TYPE_WATCH`, `WEB_PAGE_TYPE_CHANNEL`, or `WEB_PAGE_TYPE_PLAYLIST` | Supports all YouTube URL formats: full watch URLs, short links (youtu.be), share links, channel URLs, and playlist URLs. --- ## YouTube Screenshot *Source: youtube-api/screenshot.mdx* <Endpoint method="POST" path="/v1/youtube/screenshot" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/screenshot', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'dQw4w9WgXcQ', timestamp: '00:00:50' }), }); const { data } = await res.json(); console.log(data.link); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/screenshot \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "dQw4w9WgXcQ", "timestamp": "00:00:50"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube video ID | — | | `timestamp` | `string` | No | Time in HH:MM:SS format | `00:00:50` | ### Response **Response:** ```json { "ok": true, "data": { "link": ["https://screenshot-url.jpg"], "status": "done" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.link` | `string[]` | Array containing the URL(s) of the captured screenshot image(s) | | `data.status` | `string` | Processing status: `done` when the screenshot is ready | --- ## YouTube Search *Source: youtube-api/search.mdx* <Endpoint method="POST" path="/v1/youtube/search" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/search', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'nextjs tutorial', type: 'video' }), }); const { data } = await res.json(); console.log(data.data); // array of video results ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/search \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "nextjs tutorial", "type": "video"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query | — | | `type` | `string` | No | Filter: `video`, `channel`, `playlist` | all | | `sort` | `string` | No | Sort: `upload_date`, `view_count`, `rating` | relevance | | `duration` | `string` | No | Duration filter | — | | `upload_date` | `string` | No | Upload date filter | — | | `features` | `string` | No | Feature filter | — | | `geo` | `string` | No | Country code (e.g. `US`) | — | | `lang` | `string` | No | Language code (e.g. `en`) | — | | `token` | `string` | No | Continuation token for pagination | — | ### Response **Response:** ```json { "ok": true, "data": { "estimatedResults": "675836", "continuation": "EqQD...", "data": [ { "type": "video", "videoId": "ZVnjOPwW4ZA", "title": "Next js Tutorial for Beginners | Nextjs 13 (App Router) with TypeScript", "channelTitle": "Programming with Mosh", "channelId": "UCWv7vMbMWH4-V0ZXdmDpPBA", "channelHandle": "@programmingwithmosh", "channelBadges": ["Verified"], "isVerifiedChannel": true, "description": "Master Next.js 13 and build amazing full-stack apps! This beginner-friendly tutorial covers the new App Router, TypeScript, and ...", "viewCount": "1275546", "viewCountText": "1,275,546 views", "publishDate": "2024-04-13", "publishedAt": "2024-04-13T00:00:00Z", "publishedTimeText": "2 years ago", "lengthText": "1:02:55", "thumbnail": [ { "url": "https://i.ytimg.com/vi/ZVnjOPwW4ZA/hq720.jpg", "width": 360, "height": 202 }, { "url": "https://i.ytimg.com/vi/ZVnjOPwW4ZA/hq720.jpg", "width": 720, "height": 404 } ], "richThumbnail": [ { "url": "https://i.ytimg.com/an_webp/ZVnjOPwW4ZA/mqdefault_6s.webp", "width": 320, "height": 180 } ], "channelThumbnail": [ { "url": "https://yt3.ggpht.com/...=s68-c-k-c0x00ffffff-no-rj", "width": 68, "height": 68 } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.estimatedResults` | `string` | Estimated total number of matching results | | `data.continuation` | `string` | Token to fetch the next page of results | | `data.data` | `object[]` | Array of search results | | `data.data[].type` | `string` | Result type: `video`, `channel`, or `playlist` | | `data.data[].videoId` | `string` | Unique YouTube video identifier | | `data.data[].title` | `string` | Video title as displayed on YouTube | | `data.data[].channelTitle` | `string` | Name of the channel that uploaded the video | | `data.data[].channelId` | `string` | Unique identifier for the channel | | `data.data[].channelHandle` | `string` | Channel handle (e.g. `@programmingwithmosh`) | | `data.data[].channelBadges` | `string[]` | Channel verification badges (e.g. `Verified`) | | `data.data[].isVerifiedChannel` | `boolean` | Whether the channel is verified | | `data.data[].description` | `string` | Snippet of the video description shown in search results | | `data.data[].viewCount` | `string` | Raw view count as a numeric string | | `data.data[].viewCountText` | `string` | Human-readable view count (e.g. `1,275,546 views`) | | `data.data[].publishDate` | `string` | Publish date in `YYYY-MM-DD` format | | `data.data[].publishedAt` | `string` | Publish date as ISO 8601 timestamp | | `data.data[].publishedTimeText` | `string` | Relative publish time (e.g. `2 years ago`) | | `data.data[].lengthText` | `string` | Video duration in `H:MM:SS` or `MM:SS` format | | `data.data[].thumbnail` | `object[]` | Video thumbnail images at various resolutions | | `data.data[].richThumbnail` | `object[]` | Animated preview thumbnail (webp format) | | `data.data[].channelThumbnail` | `object[]` | Channel avatar images | | `data.data[].badges` | `string[]` | Video badges (e.g. `4K`, `CC`, `Beginner`) | Use the `continuation` token from the response as the `token` parameter to fetch the next page of results. --- ## Shorts Info *Source: youtube-api/shorts-info.mdx* <Endpoint method="POST" path="/v1/youtube/shorts-info" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/shorts-info', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'abc123' }), }); const { data } = await res.json(); console.log(data.title, data.viewCount); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/shorts-info \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "abc123"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube video/short ID | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "id": "abc123", "title": "Funny Short", "channelTitle": "Creator", "channelId": "UCxyz...", "viewCount": "5000000", "likeCount": 250000, "description": "Wait till the end!", "publishDate": "2026-03-15" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.id` | `string` | YouTube Short/video identifier | | `data.title` | `string` | Short title as displayed on YouTube | | `data.channelTitle` | `string` | Name of the channel that uploaded the Short | | `data.channelId` | `string` | Unique identifier for the channel | | `data.viewCount` | `string` | Total view count as a numeric string | | `data.likeCount` | `number` | Total number of likes | | `data.description` | `string` | Short description text | | `data.publishDate` | `string` | Publish date in `YYYY-MM-DD` format | --- ## YouTube Shorts Feed *Source: youtube-api/shorts.mdx* <Endpoint method="POST" path="/v1/youtube/shorts" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/shorts', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ params: 'continuation_token_here' }), }); const { data } = await res.json(); console.log(data.data, data.continuation); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/shorts \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"params": "continuation_token_here"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `params` | `string` | Yes | Continuation token from previous response | — | ### Response **Response:** ```json { "ok": true, "data": { "data": [ { "type": "shorts", "videoId": "abc123", "title": "Wait for the ending...", "viewCountText": "1.2M views", "thumbnail": [ { "url": "https://i.ytimg.com/vi/abc123/hqdefault.jpg", "width": 168, "height": 94 } ] } ], "continuation": "4qmF..." } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data` | `object[]` | Array of Shorts objects | | `data.data[].type` | `string` | Content type (typically `shorts`) | | `data.data[].videoId` | `string` | Unique YouTube video/Short identifier | | `data.data[].title` | `string` | Short title as displayed on YouTube | | `data.data[].viewCountText` | `string` | Human-readable view count (e.g. `1.2M views`) | | `data.data[].thumbnail` | `object[]` | Thumbnail images at various resolutions | | `data.continuation` | `string` | Token to continue fetching the next batch of Shorts | --- ## YouTube Subtitles *Source: youtube-api/subtitles.mdx* <Endpoint method="POST" path="/v1/youtube/subtitles" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/subtitles', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'dQw4w9WgXcQ' }), }); const { data } = await res.json(); console.log(data.subtitles); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/subtitles \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "dQw4w9WgXcQ"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube video ID | — | ### Response **Response:** ```json { "ok": true, "data": { "format": "srv1", "subtitles": [ { "languageName": "English", "languageCode": "en", "isTranslatable": true, "url": "https://www.youtube.com/api/timedtext?v=dQw4w9WgXcQ&lang=en&fmt=srv1" }, { "languageName": "English (auto-generated)", "languageCode": "en", "isTranslatable": true, "url": "https://www.youtube.com/api/timedtext?v=dQw4w9WgXcQ&kind=asr&lang=en&fmt=srv1" }, { "languageName": "Japanese", "languageCode": "ja", "isTranslatable": true, "url": "https://www.youtube.com/api/timedtext?v=dQw4w9WgXcQ&lang=ja&fmt=srv1" } ], "translationLanguages": [ { "languageCode": "af", "languageName": "Afrikaans" }, { "languageCode": "sq", "languageName": "Albanian" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.format` | `string` | Subtitle format (e.g. `srv1`) | | `data.subtitles` | `object[]` | Array of available subtitle tracks | | `data.subtitles[].languageName` | `string` | Human-readable language name (e.g. `English`, `Japanese`) | | `data.subtitles[].languageCode` | `string` | ISO language code (e.g. `en`, `ja`, `de-DE`) | | `data.subtitles[].isTranslatable` | `boolean` | Whether the track supports auto-translation | | `data.subtitles[].url` | `string` | Direct URL to download the subtitle file | | `data.translationLanguages` | `object[]` | Available languages for auto-translation | | `data.translationLanguages[].languageCode` | `string` | ISO language code for translation target | | `data.translationLanguages[].languageName` | `string` | Human-readable language name for translation target | --- ## YouTube Suggest *Source: youtube-api/suggest.mdx* <Endpoint method="POST" path="/v1/youtube/suggest" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/suggest', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ query: 'never gonna' }), }); const { data } = await res.json(); console.log(data.suggestions); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/suggest \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "never gonna"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `query` | `string` | Yes | Search query | — | ### Response **Response:** ```json { "ok": true, "data": { "query": "nextjs", "suggestions": [ "next js", "next js 16", "next js conf", "next js project", "nextjs auth", "next js supabase", "next js 15", "next js app", "next js prisma", "next js cve", "nextjs blog", "next js ai", "next js vs react", "next js conf 2025" ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.query` | `string` | The original search query that was submitted | | `data.suggestions` | `string[]` | Array of autocomplete suggestions from YouTube | --- ## YouTube Transcript *Source: youtube-api/transcript.mdx* <Endpoint method="POST" path="/v1/youtube/transcript" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/transcript', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'dQw4w9WgXcQ' }), }); const { data } = await res.json(); console.log(data.transcript); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/transcript \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "dQw4w9WgXcQ"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube video ID | — | | `lang` | `string` | No | Language code | `en` | ### Response **Response:** ```json { "ok": true, "data": { "id": "dQw4w9WgXcQ", "selected": { "languageCode": "en", "title": "English (auto-generated)" }, "languageMenu": { "languageCode": "es-419", "title": "Spanish (Latin America)" }, "transcript": [ { "startMs": "320", "endMs": "14580", "startTime": "0:00", "text": "[Music]" }, { "startMs": "18800", "endMs": "25960", "startTime": "0:18", "text": "We're no strangers to" }, { "startMs": "21800", "endMs": "29119", "startTime": "0:21", "text": "love. You know the rules and so do" } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.id` | `string` | YouTube video identifier | | `data.selected` | `object` | Currently selected transcript language | | `data.selected.languageCode` | `string` | Language code of the selected transcript (e.g. `en`) | | `data.selected.title` | `string` | Display name of the selected language (e.g. `English (auto-generated)`) | | `data.languageMenu` | `object` | Default alternative language option | | `data.languageMenu.languageCode` | `string` | Language code of the alternative (e.g. `es-419`) | | `data.languageMenu.title` | `string` | Display name of the alternative language | | `data.transcript` | `object[]` | Array of transcript segments | | `data.transcript[].startMs` | `string` | Segment start time in milliseconds | | `data.transcript[].endMs` | `string` | Segment end time in milliseconds | | `data.transcript[].startTime` | `string` | Human-readable start time (e.g. `0:18`) | | `data.transcript[].text` | `string` | Transcript text content for this segment | --- ## Trending Videos *Source: youtube-api/trending.mdx* <Endpoint method="POST" path="/v1/youtube/trending" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/trending', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ geo: 'US', type: 'now' }), }); const { data } = await res.json(); console.log(data.data); // array of trending videos ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/trending \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"geo": "US", "type": "now"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `geo` | `string` | No | Country code (e.g. `US`, `GB`, `IN`) | — | | `type` | `string` | No | Category: `now`, `music`, `gaming`, `movies` | `now` | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "data": [ { "type": "video", "videoId": "XelMqi0jlvk", "title": "Christmas Songs Playlist - Top 2 Hour Christmas Songs", "channelId": "UCn0JHLJWiO3_Y5xfNPcF_Ug", "channelTitle": "Christmas Songs and Carols - Love to Sing", "description": "Enjoy the festive classic Top Christmas Songs...", "viewCount": "15200000", "commentCount": "61", "likeCount": "85000", "publishedTimeText": "3 months ago", "publishedAt": "2026-01-13T00:00:00Z", "lengthText": "2:05:32", "thumbnail": [ { "url": "https://i.ytimg.com/vi/XelMqi0jlvk/hq720.jpg", "width": 720, "height": 404 } ], "richThumbnail": [ { "url": "https://i.ytimg.com/an_webp/XelMqi0jlvk/mqdefault_6s.webp", "width": 320, "height": 180 } ] } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.data` | `object[]` | Array of trending video results | | `data.data[].type` | `string` | Content type (always `video` for trending) | | `data.data[].videoId` | `string` | Unique YouTube video identifier | | `data.data[].title` | `string` | Video title as displayed on YouTube | | `data.data[].channelId` | `string` | Unique identifier for the channel | | `data.data[].channelTitle` | `string` | Name of the channel that uploaded the video | | `data.data[].description` | `string` | Full video description text | | `data.data[].viewCount` | `string` | Total view count as a numeric string | | `data.data[].commentCount` | `string` | Total number of comments | | `data.data[].likeCount` | `string` | Total number of likes | | `data.data[].publishedTimeText` | `string` | Relative publish time (e.g. `3 months ago`) | | `data.data[].publishedAt` | `string` | Publish date as ISO 8601 timestamp | | `data.data[].lengthText` | `string` | Video duration in `H:MM:SS` or `MM:SS` format | | `data.data[].thumbnail` | `object[]` | Video thumbnail images at various resolutions | | `data.data[].richThumbnail` | `object[]` | Animated preview thumbnail (webp format) | | `data.data[].channelThumbnail` | `object[]` | Channel avatar images | --- ## Video Info *Source: youtube-api/video-info.mdx* <Endpoint method="POST" path="/v1/youtube/video-info" cost={0.01} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/video-info', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'dQw4w9WgXcQ' }), }); const { data } = await res.json(); console.log(data.title, data.channelTitle); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/video-info \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "dQw4w9WgXcQ"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube video ID | — | | `geo` | `string` | No | Country code for geo-specific results | — | | `lang` | `string` | No | Language code | — | ### Response **Response:** ```json { "ok": true, "data": { "id": "dQw4w9WgXcQ", "title": "Rick Astley - Never Gonna Give You Up", "channelTitle": "Rick Astley", "viewCount": "1758165530", "publishDate": "2009-10-25" } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.id` | `string` | YouTube video identifier | | `data.title` | `string` | Full video title | | `data.channelTitle` | `string` | Name of the channel that uploaded the video | | `data.channelId` | `string` | Unique identifier for the channel | | `data.description` | `string` | Full video description text | | `data.viewCount` | `string` | Total view count as a numeric string | | `data.publishDate` | `string` | Publish date in `YYYY-MM-DD` format | | `data.thumbnail` | `object[]` | Thumbnail images at various resolutions | | `data.keywords` | `string[]` | Tags and keywords associated with the video | | `data.lengthSeconds` | `string` | Video duration in seconds | --- ## Video Details *Source: youtube-api/video.mdx* <Endpoint method="POST" path="/v1/youtube/video" cost={0.02} /> ## Usage ```typescript const res = await fetch('https://api.yepapi.com/v1/youtube/video', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ id: 'dQw4w9WgXcQ' }), }); const { data } = await res.json(); console.log(data.title, data.viewCount); ``` ```bash curl -X POST https://api.yepapi.com/v1/youtube/video \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"id": "dQw4w9WgXcQ"}' ``` ### Request Body | Parameter | Type | Required | Description | Default | | :--- | :--- | :--- | :--- | :--- | | `id` | `string` | Yes | YouTube video ID | — | | `geo` | `string` | No | Country code for geo-specific results | — | ### Response **Response:** ```json { "ok": true, "data": { "status": "OK", "id": "dQw4w9WgXcQ", "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)", "lengthSeconds": 213, "keywords": ["rick astley", "Never Gonna Give You Up", "rickroll"], "channelTitle": "Rick Astley", "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw", "description": "The official video for \"Never Gonna Give You Up\" by Rick Astley...", "viewCount": 1762255485, "allowRatings": true, "isLiveContent": false, "isPrivate": false, "thumbnail": [ { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/default.jpg", "width": 120, "height": 90 }, { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg", "width": 1920, "height": 1080 } ], "formats": [ { "itag": 18, "mimeType": "video/mp4", "quality": "medium", "qualityLabel": "360p", "width": 640, "height": 360, "url": "https://redirector.googlevideo.com/videoplayback?..." } ], "adaptiveFormats": [ { "itag": 313, "mimeType": "video/webm; codecs=\"vp9\"", "quality": "hd2160", "qualityLabel": "2160p", "width": 3840, "height": 2160, "fps": 25, "bitrate": 18076636, "contentLength": "358608461", "url": "https://redirector.googlevideo.com/videoplayback?..." } ], "captions": { "captionTracks": [ { "languageCode": "en", "kind": "asr" } ] }, "storyboards": [ { "url": "https://...", "width": 48, "height": 27 } ] } } ``` ### Response Fields | Field | Type | Description | | :--- | :--- | :--- | | `ok` | `boolean` | Whether the request succeeded | | `data.status` | `string` | Video status (e.g. `OK`, `ERROR`) | | `data.id` | `string` | YouTube video identifier | | `data.title` | `string` | Full video title | | `data.lengthSeconds` | `number` | Video duration in seconds | | `data.keywords` | `string[]` | Tags and keywords associated with the video | | `data.channelTitle` | `string` | Name of the channel that uploaded the video | | `data.channelId` | `string` | Unique identifier for the channel | | `data.description` | `string` | Full video description text | | `data.viewCount` | `number` | Total number of views | | `data.allowRatings` | `boolean` | Whether likes/dislikes are enabled | | `data.isLiveContent` | `boolean` | Whether this is a livestream | | `data.isPrivate` | `boolean` | Whether the video is private | | `data.thumbnail` | `object[]` | Thumbnail images at various resolutions | | `data.formats` | `object[]` | Muxed (audio+video) streaming formats | | `data.formats[].itag` | `number` | YouTube format identifier | | `data.formats[].mimeType` | `string` | MIME type and codec info | | `data.formats[].quality` | `string` | Quality level (e.g. `medium`, `hd720`) | | `data.formats[].qualityLabel` | `string` | Human-readable quality (e.g. `360p`) | | `data.formats[].url` | `string` | Direct streaming URL | | `data.adaptiveFormats` | `object[]` | Separate audio/video adaptive streaming formats | | `data.adaptiveFormats[].itag` | `number` | YouTube format identifier | | `data.adaptiveFormats[].mimeType` | `string` | MIME type and codec info | | `data.adaptiveFormats[].quality` | `string` | Quality level (e.g. `hd2160`) | | `data.adaptiveFormats[].qualityLabel` | `string` | Human-readable quality (e.g. `2160p`) | | `data.adaptiveFormats[].width` | `number` | Video width in pixels | | `data.adaptiveFormats[].height` | `number` | Video height in pixels | | `data.adaptiveFormats[].fps` | `number` | Frames per second | | `data.adaptiveFormats[].bitrate` | `number` | Peak bitrate in bits per second | | `data.adaptiveFormats[].contentLength` | `string` | File size in bytes | | `data.adaptiveFormats[].url` | `string` | Direct streaming URL | | `data.captions` | `object` | Caption/subtitle track information | | `data.storyboards` | `object[]` | Storyboard sprite sheet images for seek preview | This endpoint costs 2¢ per call (6 quota units upstream) because it returns comprehensive video metadata including available formats. ---