Skip to content

Execute HTTP requests through the cURL engine using either the simplified GET interface or the full-configuration POST interface. Subscribe to asynchronous job lifecycle events over WebSocket for real-time progress tracking.

GET /api/v1/curl/request

Simplified interface for executing HTTP requests using URL query parameters. Best suited for simple GET requests and quick testing. For advanced features use the POST endpoint.

NameInTypeRequiredDescription
urlquerystringYesTarget URL
methodquerystringNoHTTP method (default: GET)
responsequerystringNoResponse mode: transparent or json (default: json)
modequerystringNoExecution mode: sync or async (default: sync)
session_idquerystringNoSession ID for cookie persistence
follow_redirectsquerybooleanNoFollow redirects (default: true)
timeoutqueryintegerNoTimeout in seconds
user_agentquerystringNoUser-Agent header
refererquerystringNoReferer header
bearer_tokenquerystringNoBearer token
savequerybooleanNoSave to storage
save_pathquerystringNoCustom save path, relative to downloads/by-job/{job_id} (no absolute paths or ..)
insecurequerybooleanNoAllow insecure SSL
compressedquerybooleanNoRequest compressed
job_namequerystringNoJob name for async
dataquerystringNoRaw request body (curl --data); alias body; presence upgrades default method to POST
jsonquerystringNoJSON request body, sent with Content-Type: application/json (curl --json); upgrades default method to POST
headerquerystringNoCustom header as Name: Value. Repeatable — supply once per header
data_base64querystringNoBase64 request body (binary-safe; standard or URL-safe); alias body_base64. Takes precedence over data/json; upgrades default method to POST

This endpoint accepts no body.

Terminal window
curl -X GET "https://api.example.com/api/v1/curl/request?url=https%3A%2F%2Fhttpbin.org%2Fget&method=GET&response=json&timeout=30"

Execute HTTP request with full cURL capabilities

Section titled “Execute HTTP request with full cURL capabilities”

POST /api/v1/curl/request

Execute an HTTP request using libcurl with comprehensive configuration options. Supports both synchronous (immediate response) and asynchronous (background job) execution modes. Includes advanced features like retry logic, cookie sessions, proxy configuration, and automatic response storage.

Execution Modes:

  • sync (default): Blocks until completion, returns immediate response
  • async: Returns job ID immediately, executes in background

Response Modes:

  • transparent (default): Returns raw response with original headers
  • json: Wraps response in JSON with timing metrics and metadata

This endpoint takes no path, query, or header parameters.

The request body conforms to the CurlRequest schema. The only required field is url; all other fields are optional.

Terminal window
curl -X POST "https://api.example.com/api/v1/curl/request" \
-H "Content-Type: application/json" \
-d '{
"url": "https://httpbin.org/post",
"method": "POST",
"mode": "sync",
"response": "json",
"headers": {
"Accept": "application/json",
"X-Request-ID": "abc-123"
},
"json": "{\"name\":\"hoody\",\"version\":1}",
"retry_count": 3,
"retry_delay": 1000,
"follow_redirects": true,
"timeout": 30
}'

GET /api/v1/curl/ws

Establish a WebSocket connection that receives job lifecycle events in JSON.

Message types:

  • jobstarted — emitted with {job_id, name} when a new job begins execution
  • jobprogress — emitted with {job_id, progress} where progress is a fraction from 0 to 1
  • jobcompleted — emitted with {job_id, status} when a job finishes
  • error — emitted with {message} when an error occurs

Filtering:

  • Pass job_id as a query parameter to only receive events for a single job.
NameInTypeRequiredDescription
job_idquerystringNoOptional job ID filter

This endpoint accepts no body.

// Connect to the events stream filtered by job_id
const ws = new WebSocket(
"wss://api.example.com/api/v1/curl/ws?job_id=01HMZ8X9K2QF3N5P7R8T6V4WYD"
);
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log(data);
};
// Example incoming frames:
// { "type": "jobstarted", "job_id": "01HMZ8X9K2QF3N5P7R8T6V4WYD", "name": "fetch-feed" }
// { "type": "jobprogress", "job_id": "01HMZ8X9K2QF3N5P7R8T6V4WYD", "progress": 0.42 }
// { "type": "jobcompleted", "job_id": "01HMZ8X9K2QF3N5P7R8T6V4WYD", "status": "success" }
// { "type": "error", "message": "Connection reset by peer" }