HTTP Status Check API
This API performs a real-time health check on any URL. It measures the response time (latency), captures the HTTP status code, and identifies the server IP.
Endpoint
Section titled “Endpoint” POST
/api/v1/http-status Request Parameters
Section titled “Request Parameters”The following parameters are accepted in the request body:
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The URL to inspect. |
Request Examples
Section titled “Request Examples”curl -X POST https://heavstal.com.ng/api/v1/http-status \-H "Content-Type: application/json" \-H "x-api-key: <YOUR_API_KEY>" \-d '{"url": "https://github.com"}'const response = await fetch('https://heavstal.com.ng/api/v1/http-status', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': '<YOUR_API_KEY>' }, body: JSON.stringify({ url: 'https://github.com' })});
const res = await response.json();console.log(res.data);import { tools } from '@heavstal/api';
const status = await tools.httpStatus("https://github.com");console.log(`Status: ${status.data.status} | Latency: ${status.data.latency}`);import requests
url = "https://heavstal.com.ng/api/v1/http-status"headers = { "Content-Type": "application/json", "x-api-key": "<YOUR_API_KEY>"}payload = { "url": "https://github.com"}
response = requests.post(url, headers=headers, json=payload)print(response.json()["data"])Response Examples
Section titled “Response Examples”{ "status": "success", "creator": "HEAVSTAL TECH", "data": { "url": "https://github.com", "status": "UP", "code": 200, "latency": "145ms", "ip": "140.82.121.3" }}{ "status": "error", "error": "Invalid URL provided."}