A simple JSON search API. Send a query, get results back.
Returns up to 30 web search results as JSON.
| Param | In | Required | Description |
|---|---|---|---|
| x-api-key | header | yes * | Your API key |
| apikey | query | yes * | Alternative to the header |
| q | query | yes | Search query string |
| num | query | no | Number of results (default 10, max 30) |
* provide one of the two
{
"query": "openai",
"count": 10,
"results": [
{
"title": "OpenAI",
"url": "https://openai.com",
"displayUrl": "openai.com",
"snippet": "An AI safety company..."
}
]
}
{ "error": "invalid_api_key", "message": "..." }
const res = await fetch(
'https://bixx.agency/api/search?q=openai&num=5',
{ headers: { 'x-api-key': 'YOUR_API_KEY' } }
);
const data = await res.json();
console.log(data.results);
import axios from 'axios';
const { data } = await axios.get(
'https://bixx.agency/api/search',
{
params: { q: 'openai', num: 5 },
headers: { 'x-api-key': 'YOUR_API_KEY' },
}
);
console.log(data.results);
import requests
response = requests.get(
'https://bixx.agency/api/search',
params={'q': 'openai', 'num': 5},
headers={'x-api-key': 'YOUR_API_KEY'},
)
data = response.json()
for r in data['results']:
print(r['title'], r['url'])
import httpx
import asyncio
async def search(q):
async with httpx.AsyncClient() as client:
r = await client.get(
'https://bixx.agency/api/search',
params={'q': q, 'num': 5},
headers={'x-api-key': 'YOUR_API_KEY'},
)
return r.json()
data = asyncio.run(search('openai'))
print(data['results'])
curl -G 'https://bixx.agency/api/search' \ -H 'x-api-key: YOUR_API_KEY' \ --data-urlencode 'q=openai' \ -d 'num=5'
curl 'https://bixx.agency/api/search?q=openai&num=5&apikey=YOUR_API_KEY'