API Documentation

Programmatic access to website analysis

Authentication Optional

Anonymous users can use the API with 100 requests per day (IP-based rate limiting).

Create Account to get 2x rate limit and track usage.

Authentication (Optional)

API access works both with and without authentication. Authenticated users get 2x rate limits.

Anonymous Access (100 requests/day)

# No authentication needed
curl "https://locapeak.com/api/analyze?url=example.com"

Authenticated Access (200 requests/day)

Provide your API token using either method:

Option 1: Authorization Header (Recommended)
Authorization: Bearer YOUR_API_TOKEN
Option 2: X-API-Token Header
X-API-Token: YOUR_API_TOKEN

Get your token: Sign up at /signup and view your token on the Account page.

Endpoints

Website Analysis

GET /api/analyze?url={website_url}

Multi-Region Ping

POST /api/ping
Content-Type: application/json

{
  "target": "example.com",
  "count": 4
}

Ping Sweep (IP Discovery)

POST /api/pingsweep
Content-Type: application/json

{
  "input": "8.8.8.8\n192.168.1.0/24\n2001:4860:4860::8888"
}

Supports multiple IPs and CIDRs (IPv4 & IPv6, max 512 IPs). Enter one per line or use newline separators.

IP Address Lookup

GET /api/ip-lookup?ip={ip_address}

Get geolocation, ASN, and privacy information for any IPv4 or IPv6 address.

Example:

curl "https://locapeak.com/api/ip-lookup?ip=8.8.8.8"

Returns JSON with country, city, region, coordinates, and ASN information. Bogon IPs (private networks) are flagged.

ASN Lookup

GET /api/network/asn/{asn}

Lookup autonomous system by ASN number (with or without AS prefix).

Example:

curl "https://locapeak.com/api/network/asn/AS15169"
curl "https://locapeak.com/api/network/asn/15169"

Returns ASN, AS name, AS domain, IPv4 prefixes, and IPv6 prefixes.

Domain Network Lookup

GET /api/network/domain/{domain}

Lookup network information by AS domain name.

Example:

curl "https://locapeak.com/api/network/domain/google.com"

Returns list of ASNs, prefixes (IPv4 & IPv6), and countries associated with the domain.

Country Network Lookup

GET /api/network/countries/{country_codes}

Lookup all network prefixes for one or more countries (comma-separated).

Example:

curl "https://locapeak.com/api/network/countries/US"
curl "https://locapeak.com/api/network/countries/US,CA,MX"

Returns all IPv4 and IPv6 prefixes allocated to the specified countries.

WHOIS Lookup

POST /api/whois
Content-Type: application/json

{
    "input": "example.com"
}

Lookup WHOIS and RDAP data for a domain or IP address.

Example:

curl -X POST "https://locapeak.com/api/whois" \
    -H "Content-Type: application/json" \
    -d '{"input": "8.8.8.8"}'

Health Checks

GET /health                      # Main application health
GET /api/ip-lookup/health        # IP lookup service health
GET /api/network/health          # Network data service health

Health endpoints return service status and database counts.

Admin - Manual Database Update

POST /api/admin/update-databases
Authorization: Bearer YOUR_API_TOKEN

Manually trigger database updates (requires authentication).

Multi-Region Traceroute

POST /api/traceroute
Content-Type: application/json

{
  "target": "example.com"
}

IP Address Extractor

The IP Extractor tool runs entirely in your browser (client-side JavaScript). No API endpoint available – all processing is done locally for privacy and speed.

Parameters
Parameter Type Required Description
url string Yes The website URL to analyze (e.g., example.com or https://example.com)
Rate Limiting

Rate limits are based on your account's API multiplier:

  • Default (signed up users): 2x multiplier = 200 requests/day per endpoint
  • Premium users: Custom multipliers available (contact support)
  • Base limits: 100 requests/day per endpoint (before multiplier)

Rate limit information is included in the response:

{
  "rate_limit": {
    "limit": 200,
    "remaining": 199,
    "window": "24 hours"
  }
}
Example Requests

cURL - Website Analysis

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
  "https://locapeak.com/api/analyze?url=example.com"

cURL - Ping

curl -X POST \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"target": "example.com", "count": 4}' \
  "https://locapeak.com/api/ping"

Python - Website Analysis

import requests

headers = {
    "Authorization": "Bearer YOUR_API_TOKEN"
}

response = requests.get(
    "https://locapeak.com/api/analyze",
    params={"url": "example.com"},
    headers=headers
)
data = response.json()
print(data)

Python - Traceroute

import requests

headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.post(
    "https://locapeak.com/api/traceroute",
    json={"target": "example.com"},
    headers=headers
)
data = response.json()
print(data)

JavaScript

const headers = {
  "Authorization": "Bearer YOUR_API_TOKEN"
};

fetch('https://locapeak.com/api/analyze?url=example.com', { headers })
  .then(response => response.json())
  .then(data => console.log(data));
Response Structure
{
  "url": "https://example.com",
  "domain": "example.com",
  "dns": {
    "domain": "example.com",
    "a_record": "93.184.216.34",
    "ns_records": ["..."],
    "mx_records": ["..."],
    "txt_records": ["..."]
  },
  "ssl": {
    "issuer": {...},
    "subject": {...},
    "valid_from": "...",
    "valid_to": "...",
    "version": 3
  },
  "page": {
    "title": "Example Domain",
    "description": "Example description",
    "generator": null,
    "server": "nginx"
  },
  "social_links": {
    "Twitter": ["https://twitter.com/example"],
    "Facebook": ["https://facebook.com/example"]
  },
  "external_links": {
    "count": 10,
    "domains": ["..."]
  },
  "technologies": {
    "js_frameworks": ["React.js"],
    "css_frameworks": ["Bootstrap"],
    "analytics": ["Google Analytics"],
    "antibot": [],
    "marketing": [],
    "payment": []
  },
  "providers": {
    "registrar": "GoDaddy",
    "mail_provider": "Google Workspace"
  },
  "screenshot_url": "/screenshot/...",
  "rate_limit": {
    "limit": 5,
    "remaining": 4,
    "window": "24 hours"
  }
}
Error Responses

Rate Limit Exceeded (429)

{
  "error": "Rate limit exceeded",
  "requests_made": 5,
  "limit": 5,
  "window": "24 hours"
}

Server Error (500)

{
  "error": "Error analyzing website: ..."
}

Try the Web Interface