Introduction
Search1API's Search endpoint provides developers with a powerful, cost-effective way to integrate search capabilities into their applications. In this guide, we'll explore the basic search functionality, advanced features, and batch processing capabilities.
Authentication
All Search1API endpoints require authentication using Bearer token. Include your API key in the Authorization header:
Authorization: Bearer your_api_key_here Basic Search
Making Your First Search Request
POST https://api.search1api.com/search { "query": "artificial intelligence", "search_service": "google",
"max_results": 5,
"language": "en-US",
"time_range": "month"
} The API will respond with structured results:
{
"searchParameters": {
"query": "artificial intelligence",
"search_service": "google",
"max_results": 5,
"language": "en-US",
"time_range": "month"
},
"results": [
{
"title": "What is Artificial Intelligence?",
"link": "https://example.com/ai",
"snippet": "Artificial Intelligence (AI) is the simulation of human intelligence..."
}
// Additional results...
]
} Query Parameters
query: Your search termsearch_service: The search engine to use (options: "google", "bing", "duckduckgo", "yahoo", "youtube", "x","reddit", "github", "arxiv", "wechat", "bilibili", "imdb", "wikipedia" default: "google")max_results: Number of results to return (default: 5)language: Language preference for search results (e.g., "en", "en-US", "zh", "zh-CN")time_range: Time range for search results ("day", "month", "year" - representing the last day, month, or year)include_sites: List of sites to include in search results (optional)exclude_sites: List of sites to exclude from search results (optional)
Batch Processing
Search API supports batch processing for improved efficiency. Send multiple queries in a single API call:
Batch Search Request
POST https://api.search1api.com/search
[
{
"query": "artificial intelligence",
"max_results": 3
},
{
"query": "machine learning",
"search_service": "google",
"image": true,
"max_results": 2
},
{
"query": "deep learning",
"crawl_results": 1,
"max_results": 2
}
] Batch Response
[
{
"searchParameters": {
"query": "artificial intelligence",
"max_results": 3
},
"results": [
{
"title": "What is AI?",
"link": "https://example.com/ai",
"snippet": "..."
}
]
},
{
"searchParameters": {
"query": "machine learning",
"max_results": 2,
"image": true
},
"results": [
{
"title": "Machine Learning Guide",
"link": "https://example.com/ml",
"snippet": "..."
}
],
"images": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"
]
},
{
"searchParameters": {
"query": "deep learning",
"crawl_results": 1,
"max_results": 2
},
"results": [
{
"title": "Deep Learning Tutorial",
"link": "https://example.com/dl",
"snippet": "...",
"content": "Full article content here..."
}
]
}
] Advanced Features
1. Integrated Image Search
Add image: true to get images with your search results:
{
"query": "machine learning",
"search_service": "google",
"image": true,
"max_results": 3
} {
"searchParameters": {
"query": "machine learning",
"search_service": "google",
"max_results": 3,
"image": true
},
"results": [
{
"title": "Introduction to Machine Learning",
"link": "https://example.com/ml",
"snippet": "Learn about machine learning fundamentals..."
}
],
"images": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg",
"https://example.com/image3.jpg"
]
} 2. Deep Search
Enable crawl_results to automatically retrieve full content:
{
"query": "climate change research",
"search_service": "google",
"max_results": 3,
"crawl_results": 1
} {
"searchParameters": {
"query": "climate change research",
"search_service": "google",
"max_results": 3,
"crawl_results": 1
},
"results": [
{
"title": "Latest Climate Change Research",
"link": "https://example.com/climate",
"snippet": "Recent findings in climate research...",
"content": "Full article content here..."
},
{
"title": "Climate Change Impact Study",
"link": "https://example.com/impact",
"snippet": "Study overview..."
}
]
} Best Practices
Batch Processing
- Recommended batch size: 5-10 requests
- Consider implementing retry logic for failed items
- Handle partial successes appropriately
Authentication
- Keep your API key secure
- Rotate keys periodically
- Use environment variables for key storage
Error Handling
- Implement proper error handling
- Handle rate limits gracefully
- Cache results when appropriate
Use Cases
- AI Applications
- Train language models with comprehensive content
- Build multimodal AI systems
- Create intelligent content aggregators
- Research Tools
- Gather detailed information
- Collect text and image data
- Analyze full article content
- Content Platforms
- Aggregate content from multiple sources
- Include relevant images
- Provide rich content previews
Why Choose Search1API?
- Fast: Optimized for quick response times
- Economic: Starting From Free
- AI-Ready: Designed for AI applications
- Flexible: Powerful batch processing
- Feature-rich: Images and full content extraction
Get Started
Visit our API documentation to start using Search1API today. Sign up now and transform your search experience!
No comments yet