fetch_url
Fetch and parse web pages with automatic redirect handling, timeout control, and custom headers. Perfect for retrieving HTML content from any publicly accessible URL.
Use Cases
Page Content Retrieval
Fetch HTML content from any webpage for further processing or analysis
API Data Fetching
Make GET requests to REST APIs and retrieve JSON responses
Health Checks
Monitor website availability and response times
Simple Downloads
Download static assets, documents, or page content
Endpoint
/api/v1/tools/fetch_url
Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
url | string | Required | - | The URL to fetch (must include protocol: http:// or https://) Example: https://example.com |
headers | object | Optional | - | Custom HTTP headers to include in the request Example: {"Accept": "text/html", "User-Agent": "MyBot/1.0"} |
timeout | number | Optional | 10000 | Request timeout in milliseconds (1000-30000) Example: 15000 |
follow_redirects | boolean | Optional | true | Whether to follow HTTP redirects automatically Example: true |
user_agent | string | Optional | - | Custom User-Agent header (overrides default) Example: Mozilla/5.0 (compatible; CrawlBot/1.0) |
Request Examples
cURL
TypeScript
Python
Response Example
{ "success": true, "data": { "url": "https://example.com", "status": 200, "status_text": "OK", "headers": { "content-type": "text/html; charset=UTF-8", "content-length": "1256", "server": "nginx" }, "content": "Example Domain ......", "content_length": 1256, "content_type": "text/html; charset=UTF-8", "redirected": false, "final_url": "https://example.com" }, "credits_used": 1, "credits_remaining": 999, "processing_time": 245}
data.url
The original URL that was requesteddata.status
HTTP status code of the responsedata.content
The full HTML content of the pagedata.content_length
Size of the content in bytesdata.final_url
Final URL after following redirectscredits_used
Credits deducted for this request (1 per fetch)credits_remaining
Your remaining credit balanceError Handling
Invalid URL (400 Bad Request)
The URL format is invalid. Ensure it includes the protocol (http:// or https://)
Timeout Error (500 Internal Server Error)
The request took longer than the specified timeout. Try increasing the timeout parameter.
Insufficient Credits (402 Payment Required)
Your account doesn't have enough credits. Purchase more credits or upgrade your plan.
Rate Limit Exceeded (429 Too Many Requests)
You've exceeded your plan's rate limit. Wait a moment or upgrade your plan for higher limits.
Credit Cost
Free Plan: 1,000 credits/month = 1,000 requests
Hobby Plan: 5,000 credits/month = 5,000 requests ($19/mo)
Professional Plan: 50,000 credits/month = 50,000 requests ($99/mo)
Business Plan: 250,000 credits/month = 250,000 requests ($399/mo)