# Send HTTP requests (`riceman/send-http-requests`) Actor

Send HTTP requests (GET, POST, PUT, PATCH, DELETE) to any API endpoint with customizable headers, parameters, and body data. Perfect for Clay users seeking API functionality without the Explorer plan upgrade, or anyone needing simple HTTP request capabilities.

- **URL**: https://apify.com/riceman/send-http-requests.md
- **Developed by:** [RICEMAN](https://apify.com/riceman) (community)
- **Categories:** Developer tools, Integrations, Automation
- **Features:** Limited permissions
- **Stats:** 1,012 total users, 74 monthly users, 100.0% runs succeeded, 10 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$0.005 / http request sent

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Send HTTP Requests

An [Apify](https://apify.com) actor that allows you to send HTTP requests to any endpoint and view the results.

### Overview

This actor provides a simple way to make HTTP requests to any API endpoint without writing code. It supports all common HTTP methods (GET, POST, PUT, PATCH, DELETE), custom headers, URL parameters, and request body data.

Perfect for:

- Clay users who need API integration without upgrading to the Explorer plan
- Testing API endpoints quickly
- One-off HTTP requests for data retrieval or actions
- Debugging web services and APIs
- Clay users who want the response data forwarded to another Clay table via webhook

### Features

- Support for all major HTTP methods (GET, POST, PUT, PATCH, DELETE)
- Custom header configuration
- URL parameter support
- Request body data (for POST, PUT, PATCH methods)
- Detailed response data including status code, headers, and body
- Simple JSON configuration
- Optional callback URL support to send the response to another endpoint (e.g., a Clay webhook)
- Optional `lookupKey` field to help match the response to the original row in a Clay table

### Input Parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `method` | String | HTTP method to use (GET, POST, PUT, PATCH, DELETE) | Yes |
| `url` | String | The URL to make the request to | Yes |
| `headers` | Object | Custom headers to be sent with the request | No |
| `params` | Object | URL parameters to be sent with the request | No |
| `data` | Object | Data to be sent as the request body (for POST, PUT, PATCH) | No |
| `callbackUrl` | String | A URL to which the full API response will be forwarded as a new POST request | No |
| `lookupKey` | String | Optional identifier for matching response to input row in a Clay workflow | No |

### Example Input

```json
{
  "method": "GET",
  "url": "https://api.example.com/data",
  "headers": {
    "Authorization": "Bearer your-token-here",
    "Content-Type": "application/json"
  },
  "params": {
    "limit": 10,
    "offset": 0
  },
  "callbackUrl": "https://webhook.site/your-webhook-url",
  "callbackHeaders": {
    "x-source": "apify-actor"
  }
}
```

### Output

The actor returns an object with the following structure:

```json
{
  "data": {}, // The response body
  "status": 200, // HTTP status code
  "statusText": "OK", // HTTP status text
  "headers": {} // Response headers
}
```

If `callbackUrl` is provided, this same object will be sent via POST to that URL.

The `lookupKey` will also be included in the callback payload to help with row matching.

### Usage with Clay

Clay users can integrate this actor into their tables to make API calls without upgrading to the Explorer plan. Here's how:

1. Create an Apify account and set up your API token
2. In Clay, use the Apify integration and select this actor
3. Configure the HTTP request parameters in the Clay interface
4. Map the response data to your Clay table columns
5. Use the `callbackUrl` input to send the full API response to a different Clay table via webhook — useful for large responses that can't be displayed in a single cell

This provides significant cost savings over upgrading to the Explorer plan ($200 difference) while still enabling API functionality.

### Limitations

- The actor has a timeout limit based on your Apify plan
- The `callbackUrl` must accept a standard JSON POST request

### Example Use Cases

1. **Fetch data from a public API**
   ```json
   {
     "method": "GET",
     "url": "https://api.publicapis.org/entries",
     "params": {
       "category": "animals",
       "https": true
     }
   }
   ```

2. **Post data to an API endpoint**
   ```json
   {
     "method": "POST",
     "url": "https://api.example.com/users",
     "headers": {
       "Content-Type": "application/json",
       "Authorization": "Bearer your-token"
     },
     "data": {
       "name": "John Doe",
       "email": "john@example.com"
     }
   }
   ```

3. **Update existing data**
   ```json
   {
     "method": "PATCH",
     "url": "https://api.example.com/users/123",
     "headers": {
       "Content-Type": "application/json",
       "Authorization": "Bearer your-token"
     },
     "data": {
       "email": "newemail@example.com"
     }
   }
   ```

### License

ISC

### Author

[Mohd Rizuan](https://linkedin.com/in/mohd-rizuan/)

# Actor input Schema

## `url` (type: `string`):

URL to make the request to

## `method` (type: `string`):

HTTP request method to be used

## `headers` (type: `object`):

Headers to be sent with the request

## `params` (type: `object`):

URL parameters to be sent with the request

## `data` (type: `object`):

Data to be sent as the request body

## `responseTimeout` (type: `integer`):

The maximum wait time for a response from the API in milliseconds.

## `callbackUrl` (type: `string`):

If provided, the actor will also send the full response to this URL

## `retryOnFailure` (type: `boolean`):

Whether to retry the request if it fails

## `maxRetries` (type: `integer`):

The maximum number of retries to attempt. Ignored if `retryOnFailure` is set to `false`.

## Actor input object example

```json
{
  "url": "https://catfact.ninja/fact",
  "method": "GET",
  "retryOnFailure": true,
  "maxRetries": 5
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset containing the HTTP response data (status, headers, body) for each request sent

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "url": "https://catfact.ninja/fact",
    "method": "GET",
    "retryOnFailure": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("riceman/send-http-requests").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "url": "https://catfact.ninja/fact",
    "method": "GET",
    "retryOnFailure": False,
}

# Run the Actor and wait for it to finish
run = client.actor("riceman/send-http-requests").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "url": "https://catfact.ninja/fact",
  "method": "GET",
  "retryOnFailure": false
}' |
apify call riceman/send-http-requests --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,riceman/send-http-requests"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/8G3zgmif2nWLm6gc7/builds/GKlrrur2qAuVqGrCd/openapi.json
