ナビゲーションにスキップ

How do I use BeatAPI Web Search tools in Claude Code or Codex MCP, and why does Python urllib return 403 (1010)?

Markdownとして表示

Unlike SEO tools (which run through capabilities_run), BeatAPI MCP (https://beatapi.io/mcp) exposes web_search, web_read, web_map, and web_research as direct top-level MCP tools with the exact same JSON arguments and prices as REST. If your Python script gets 403 with body error code: 1010 before hitting BeatAPI, you are using urllib with its default Python-urllib/* User-Agent—set a custom User-Agent header to fix it immediately.

Direct MCP tool limits in Claude Code, Cursor, and Codex

Once connected to https://beatapi.io/mcp with Authorization: Bearer <BEATAPI_API_KEY>, the four tools appear directly in your client’s tool list:

MCP toolPer-call timeoutNotes
web_search30 secondsSynchronous; returns JSON + structuredContent
web_read75 secondsSynchronous; reduce URL count or max_chars if a slow site times out
web_map60 secondsSynchronous; use select_paths to stay fast
web_research45 seconds initial waitRuns as a task; if still running after 45s, returns next to poll every 10–15s

A timeout returns processing_timeout (retryable: true) at $0 cost. See client setup configs on BeatAPI Integrations and Web Search API.

Fixing Python urllib 403 error code: 1010

The edge network in front of api.beatapi.io blocks Python urllib’s default Python-urllib/* header (curl, requests, httpx, and Node.js are unaffected). Always include a custom User-Agent with urllib:

import json, os, urllib.request
req = urllib.request.Request(
"https://api.beatapi.io/v1/web/search",
data=json.dumps({"query": "OpenAPI 3.1 webhooks", "max_results": 3}).encode(),
headers={
"Authorization": f"Bearer {os.environ['BEATAPI_API_KEY']}",
"Content-Type": "application/json",
"User-Agent": "my-agent/1.0",
},
)
with urllib.request.urlopen(req, timeout=30) as resp:
print(json.load(resp))

Explore all four tools on BeatAPI Web Search API.

Back to Web Search questions.