How to document and display AgentSerp API requests and responses
Authorization
query
Authorization: Bearer <token>
curl -X POST https://api.agentserp.com/search \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{"query": "openai"}'
json
{ "query": "openai" }
{ "data": { "results": [ { "title": "OpenAI", "url": "https://openai.com" } ] } }
{ "error": "Invalid API key" }
import requests resp = requests.post( 'https://api.agentserp.com/search', headers={'Authorization': 'Bearer <token>'}, json={'query': 'openai'} ) print(resp.json())