# Http Status Checker (`eichan/http-status-checker`) Actor

- **URL**: https://apify.com/eichan/http-status-checker.md
- **Developed by:** [Eichan Jolly](https://apify.com/eichan) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 results

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

## HTTP Status Checker

Check the HTTP status and time-to-response-headers for **1–5 public URLs** in a single run. Every input URL becomes one dataset item, even if the request fails. This Actor makes one `GET` request per valid URL, reads only response headers (not the response body), and **never follows redirects**.

### Who it's for

Developers, QA engineers, and site operators who need a quick, small-batch HTTP status check without a browser, crawling, authentication, or a monitoring service.

### Input

```json
{
  "urls": ["https://example.com/"]
}
```

- `urls` (required): array of 1–5 HTTP(S) URL strings, maximum 2048 characters each. No username/password in URLs.
- Standard ports only (`http:80`, `https:443`). Public DNS/IP destinations only.
- No authentication, cookies, login forms, external proxies, or Apify SDK.

### Output (default dataset)

One item per input URL. This **illustrative** response uses an example HTTP status and timing; the actual server response varies.

```json
{
  "url": "https://example.com/",
  "status_code": 200,
  "response_ms": 135,
  "location": null,
  "error": null
}
```

If a URL returns a `301` or `302`, the `status_code` reports that response and `location` contains its `Location` header, but the Actor does not request that destination. HTTP errors such as `404` and `503` are valid HTTP responses and **do not** populate `error`. For invalid URLs, private network targets, timeouts, TLS failures, and network failures, `status_code` and `response_ms` are `null` and `error` is a plain-language string (no tracebacks).

### Limits and safety

- **1–5 URLs per run.** Requests run sequentially with a 10-second socket timeout per URL; DNS lookup timing depends on the underlying resolver.
- Uses `GET` to observe the same status path as ordinary clients, but closes the connection after receiving headers. `response_ms` measures time until the response headers arrive, not a full-page download or browser load.
- No automatic redirects, no response bodies, no JavaScript, no cookies, and no retries.
- DNS is resolved before connecting; any non-public resolved address blocks the request. Connections use the checked IP addresses, avoiding a second DNS resolution during connect.
- Port restrictions and public-IP checks are deliberately restrictive; some valid websites or unusual hosting setups will not work.

### Storage: Apify and local execution

The Actor has **zero third-party Python dependencies**. On Apify, it uses the runtime-provided `APIFY_TOKEN` **only to read its own INPUT and append items to its default dataset via Apify's REST API**. It never sends that token to inspected websites, and it does not ask users for API keys or credentials. This platform-internal authorization is necessary to use cloud storage without the Apify SDK.

For a local run without Apify SDK, save the input example as `storage/key_value_stores/default/INPUT.json` and execute:

```sh
python src/main.py
```

Results are written to `storage/datasets/default/000000001.json`, etc. Set `APIFY_LOCAL_STORAGE_DIR` to use another storage root. Local dataset files are appended to across runs; these files do not automatically sync with Apify Console.

### Store classification and pricing suggestion

- **Apify Store category:** `DEVELOPER_TOOLS` (one declared category).
- **Suggested pricing:** Pay-per-event / per default dataset result, **USD $0.002 per URL result**. This is a recommendation, not an active charge configuration. Configure billing and the category in Apify Console before publication; `store_metadata.json` records both suggestions.

### Deployment

The folder is independently deployable as one Actor using its own `Dockerfile`, `.actor/actor.json`, and `input_schema.json`. No extra Python dependencies are needed. Build/run in Apify Console to confirm cloud storage and billing configuration before publishing.

# Actor input Schema

## `urls` (type: `array`):

One to five public HTTP(S) URLs. No credentials or nonstandard ports.

## Actor input object example

```json
{
  "urls": [
    "https://example.com/"
  ]
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing the Actor's result items

# 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 = {
    "urls": [
        "https://example.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("eichan/http-status-checker").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 = { "urls": ["https://example.com/"] }

# Run the Actor and wait for it to finish
run = client.actor("eichan/http-status-checker").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 '{
  "urls": [
    "https://example.com/"
  ]
}' |
apify call eichan/http-status-checker --silent --output-dataset

```

## MCP server setup

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

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/vasGawdybFr88EZXl/builds/JbL45MPg5TRtcD7p7/openapi.json
