API Documentation
Quick Start
Get started with SERPpost API in minutes:
- Sign up for a free account
- Get your API key from the Dashboard
- Make your first API call
Unified Response Format
All API responses follow a unified JSON format:
{
"code": 0, // 0 for success, others for failure
"msg": "", // Error message
"data": any // Response data
} Authentication
SERPpost API uses Bearer Token authentication. Include your API key in the request header:
Authorization: Bearer YOUR_API_KEY
Search API
Endpoint
POST https://serppost.com/api/search
GET https://serppost.com/api/search
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| s | string | Yes | Search keyword |
| t | string | Yes | Search engine type: google or bing |
| d | number | No | Maximum API wait time (milliseconds), default is 5000 |
| p | number | No | Page number, default is 1 |
| maxCache | number | No | Maximum cache hit time (seconds), default is 2 hours |
Request Example
bash
curl -X POST https://serppost.com/api/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"s": "artificial intelligence",
"t": "google",
"d": 5000,
"p": 1,
"maxCache": 7200
}'Response Example
{
"code": 0,
"msg": "Success",
"data": [
{
"title": "Search result title",
"url": "https://example.com",
"content": "Search result summary content..."
}
]
} URL Content Extraction API
Endpoint
POST https://serppost.com/api/url
GET https://serppost.com/api/url
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| s | string | Yes | URL to extract content from |
| t | string | Yes | Type, fixed value: url |
| w | number | No | Wait time to open URL (milliseconds), default is 1000 |
| d | number | No | Maximum API wait time (milliseconds), default is 5000 |
| maxCache | number | No | Maximum cache hit time (seconds), default is 720 hours |
| b | boolean | No | Whether to open with browser, default is false |
Request Example
bash
curl -X POST https://serppost.com/api/url \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"s": "https://example.com/article",
"t": "url",
"w": 1000,
"d": 5000,
"maxCache": 2592000,
"b": false
}'Response Example
{
"code": 0,
"msg": "Success",
"data": "Extracted web content text..."
} Response Format
All API responses follow a unified JSON format:
{
"code": 0, // 0 = success, non-zero = error
"msg": "", // Error message (if any)
"data": ... // Response data (varies by endpoint)
} • code: 0 - Request successful
• code: non-zero - Request failed, check msg field for error details
• msg - Contains error description when request fails
• data - Contains response data when successful (format varies by endpoint)
Code Examples in Multiple Languages
We provide ready-to-use code examples in 5 popular programming languages. Click the language tabs to switch between examples, and use the copy button to quickly copy the code.
Search API - Complete Example
bash
curl -X POST https://serppost.com/api/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"s": "artificial intelligence",
"t": "google",
"d": 5000,
"p": 1,
"maxCache": 7200
}'URL Extraction API - Complete Example
bash
curl -X POST https://serppost.com/api/url \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"s": "https://example.com/article",
"t": "url",
"w": 1000,
"d": 5000,
"maxCache": 2592000,
"b": false
}'Learning Resources
Technical Support
If you encounter any issues while using our API, please contact us through the following channels:
- Visit our API Playground for online testing
- Check the Pricing page for more package information
- Read our Blog for tutorials and guides
- Submit a technical support request through the Dashboard