HTTP API - Flexible Client for Prototyping and Automation avatar
HTTP API - Flexible Client for Prototyping and Automation

Pricing

$3.99/month + usage

Go to Store
HTTP API - Flexible Client for Prototyping and Automation

HTTP API - Flexible Client for Prototyping and Automation

Developed by

xyzzy

xyzzy

Maintained by Community

Easily test, integrate, and automate APIs—configure method, headers, query params, body, timeout, and retries, no code or setup required. Ideal for rapid prototyping, endpoint monitoring, workflows, and sales & marketing automation.

0.0 (0)

Pricing

$3.99/month + usage

6

Total users

36

Monthly users

5

Runs succeeded

95%

Last modified

16 days ago

HTTP API

A Apify Actor to make HTTP requests (GET, POST, PUT, PATCH, DELETE) to any API endpoint. Configure headers, query parameters, request body, timeout, retries, and more — no setup or authentication required for public APIs.


🛠️ Features

  • All common HTTP methods: GET, POST, PUT, PATCH, DELETE
  • Custom headers & query parameters: Pass arrays or objects of key/value pairs
  • Raw request body: Send any payload, including JSON or plain text
  • Configurable timeout & retries: Set request timeout and retry on failures with exponential backoff
  • Optional response metadata: Include timing, retry attempts, and headers in your output

📥 Input Parameters

Provide a JSON object with any of the following fields:

ParameterTypeRequiredDefaultDescription
endpointstring✅ YesAPI endpoint URL (e.g. https://api.example.com/v1/data).
methodstring✅ YesGETHTTP method: GET, POST, PUT, PATCH, DELETE.
querystringarray or object❌ NoQuery parameters. As array of { key, value } pairs or an object { key: value }.
headersarray or object❌ NoHTTP headers to send. As array of { key, value } pairs or an object { key: value }.
bodystring❌ NoRaw request body (e.g. JSON string). If Content-Type: application/json, actor pre-validates the JSON format.
timeoutSecondsinteger❌ No30How many seconds to wait before aborting the HTTP request.
maxRetriesinteger❌ No3Number of retry attempts on network failures (uses exponential backoff).
response_headersboolean❌ NofalseInclude response headers in the output dataset if true.
include_metaboolean❌ NofalseInclude metadata (meta field) with timing and retry information if true.

Note: The actor will throw an error if endpoint or method is missing, or if a JSON body is invalid when Content-Type: application/json is set.


📦 Output Dataset

Each run pushes one record with the following fields:

FieldTypeDescription
statusintegerHTTP status code of the response.
statusTextstringHTTP status text (e.g. "OK", "Not Found").
responseanyParsed response body (object, string, or raw data).
headersobjectResponse headers (only present if response_headers: true).
metaobjectMetadata with requestTimestamp, durationMs, and attempts (only if include_meta: true).

Errors (HTTP status ≥400) do not throw by default: you will still get the response in your dataset, and a warning is logged. Network failures after all retries will throw an error and stop the actor.


🚀 Examples

1. Simple GET (Random Cat Fact)

Input:

{
"method": "GET",
"endpoint": "https://catfact.ninja/fact"
}

Output (sample):

{
"status": 200,
"statusText": "OK",
"response": { "fact": "Cats make about 100 different sounds.", "length": 29 }
}

2. POST with Query & Headers

Input:

{
"method": "POST",
"endpoint": "https://postman-echo.com/post",
"querystring": [
{ "key": "testParam", "value": "hello" }
],
"headers": [
{ "key": "Content-Type", "value": "application/json" },
{ "key": "X-Custom-Header", "value": "ApifyTest" }
],
"body": "{\"message\":\"Hello from Apify actor!\"}",
"response_headers": true,
"include_meta": true
}

Output (sample):

{
"status": 200,
"statusText": "OK",
"response": { "args": { "testParam": "hello" }, "json": { "message": "Hello from Apify actor!" }, "url": "https://postman-echo.com/post?testParam=hello" },
"headers": { /* response headers */ },
"meta": { "requestTimestamp": "2025-04-20T12:00:00.000Z", "durationMs": 123, "attempts": 1 }
}

🔧 Advanced Options & Error Handling

  • Timeouts & Retries: Adjust timeoutSeconds and maxRetries to control how long the actor waits and how many retry attempts are used for network errors.
  • Invalid JSON Body: If you set Content-Type: application/json in headers and provide an invalid JSON string in body, the actor fails fast with an error.
  • HTTP Errors (4xx/5xx): Responses with status codes ≥400 do not cause the actor to fail — they are logged as warnings and returned in the dataset. To treat them as errors, add custom logic in a workflow or use error handling in your integration.

🧩 Explore More Actors by xyzzy

Boost your automation and intelligence workflows:


🔗 Visit the full collection on xyzzy's Apify profile