API Reference

Full HTTP API — auto-generated from the OpenAPI spec. Base URL: https://api.lightningapi.tools

Authentication

All tool endpoints require a Bearer token: Authorization: Bearer sk_<your-key>

Obtain a key by calling POST /api/v1/credits after paying a Lightning invoice (see Credits section below).

Circuits

POST /circuits/resource-reality-check Resource reality check

Checks whether a URL is reachable and gathers signals about DNS, HTTP, SSL, and content. Cost: 3 credits per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
url string URL to check
POST /circuits/scam-signal-check Scam signal check

Analyses domain age, MX configuration, email deliverability, and payment method for scam signals. Cost: 4 credits per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
domain string Domain to check
sender_email string Sender email address
payment_method string Payment method mentioned (optional)
POST /circuits/data-freshness-check Data freshness check

Checks URL reachability, domain update recency, SSL validity, and content word count for data freshness signals. Cost: 5 credits per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
url string URL to check

Credits

POST /api/v1/credits Buy credits

Creates a Lightning invoice. Pay the invoice, then call /api/v1/credits/verify to receive your API key.

Request body

FieldTypeRequiredDescription
quantity integer Number of credits to purchase (1 credit = 1 sat)
email string Optional. Associate an email with the account for recovery.
accountId string Optional. Top up an existing account.
POST /api/v1/credits/verify Verify payment and receive API key

After paying the Lightning invoice, call this endpoint to confirm payment and receive your API key.

Request body

FieldTypeRequiredDescription
invoiceId string Invoice ID from POST /api/v1/credits
quantity integer Must match quantity from the original purchase request
GET /api/v1/balance Get credit balance

Returns the current available and total credit balance for the authenticated account.

GET /events/{invoiceId} Watch for invoice payment

Server-Sent Events stream. Sends a "paid" event when the Lightning invoice is paid, "timeout" after 10 minutes, or "ping" heartbeat comments every 30s. Connect immediately after creating an invoice.

Parameters

NameInTypeRequiredDescription
invoiceId path string

Date Utils

POST /date-utils/today Get current date and time info

Returns the current date, day of week, UTC offset, DST status, working day status, week number, quarter, days until month/quarter end, next working day, and upcoming holidays. Cost: 1 credit.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
timezone string IANA timezone string. Default: UTC
country string ISO 3166-1 alpha-2. Enables holiday data.
POST /date-utils/convert-time Convert datetime between timezones

Converts an ISO 8601 datetime from one IANA timezone to another, including UTC offset and DST info. Cost: 1 credit.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
datetime string
from_timezone string
to_timezone string
POST /date-utils/is-working-day Check if a date is a working day

Returns whether a date is a working day for a given country, including holiday details if not. Cost: 1 credit.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
date string
country string
POST /date-utils/next-working-day Find next or previous working day

Finds the next (or previous) working day after a given date, skipping weekends and public holidays. Cost: 1 credit.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
date string
country string
direction string
POST /date-utils/add-working-days Add working days to a date

Adds N working days to a date (negative = backward), skipping weekends and public holidays. Cost: 1 credit.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
date string
days integer Non-zero integer, -365 to 365
country string
POST /date-utils/count-working-days Count working days in a date range

Counts working days between start and end (inclusive), excluding weekends and public holidays. Cost: 1 credit.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
start string
end string
country string
POST /date-utils/meeting-windows Find days all countries are available

Returns working day availability for 2-5 countries over a date range (max 90 days), identifying days when all countries are simultaneously available. Cost: 2 credits.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
countries array
from_date string
to_date string
POST /date-utils/timezone-overlap Find overlapping working hours across timezones

Finds the UTC window where all specified timezones are simultaneously within working hours. Cost: 1 credit.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
date string
timezones array
working_hours object

Meta

GET / API discovery root

Returns a JSON discovery document with links to the OpenAPI spec, health check, and documentation.

GET /health Health check

Returns service health status.

Tools

POST /email-validator Validate an email address

Validates an email address and returns a comprehensive quality signal including syntax, DNS, MX, disposable check, role account detection, free provider detection, domain age, and a 0-1 quality score. Cost: 2 credits per call. Idempotency-Key header is recommended — use the same key to safely retry without being charged twice.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
email string
POST /calculator Evaluate a mathematical expression

Evaluates arithmetic, algebra, trigonometry, logarithms, unit conversions, and natural language math. Accepts mathjs syntax (e.g. 'sqrt(144)', 'log(100, 10)', '1 mile to km') or plain English (e.g. 'square root of 144', '15% of 340', '100 celsius to fahrenheit'). Cost: 1 credit per call. Idempotency-Key header is recommended — use the same key to safely retry without being charged twice.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
expression string A mathematical expression in mathjs syntax or plain English.
POST /qr-code Generate a QR code

Generates a QR code as a base64 PNG string or SVG string. Cost: 1 credit per call. Idempotency-Key header is recommended — use the same key to safely retry without being charged twice.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
content string Content to encode in the QR code
format string png returns a raw base64 string. svg returns an SVG string.
size integer Width/height in pixels (PNG only)
errorCorrectionLevel string L=7%, M=15%, Q=25%, H=30% data recovery capability
POST /extract-text Extract text from a URL

Fetches a URL and extracts clean readable text using Mozilla Readability. Returns title, plain text, clean HTML, excerpt, byline, and word count. Text is cleaned of excess whitespace and HTML artefacts. All fields except url are nullable. Cost: 2 credits per call.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
url string The URL to fetch and extract content from.
POST /phone-validator Validate a phone number

Validates and parses a phone number using libphonenumber-js. Returns country, type (MOBILE/FIXED_LINE/VOIP/etc.), and formatted variants. Invalid numbers return valid:false with HTTP 200 — credits are still charged. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Recommended. Provide a stable UUID per logical request so retries don't double-charge.

Request body

FieldTypeRequiredDescription
phone string Phone number to validate. E.164 format preferred (e.g. +353861234567). National format accepted with country hint.
country string ISO 3166-1 alpha-2 country code hint for parsing national-format numbers (e.g. IE, US, GB)
POST /feels-like Apparent temperature

Calculates the apparent (feels-like) temperature using heat index or wind chill. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
temp_c number Temperature in Celsius
humidity_pct number Relative humidity percentage (0-100)
wind_speed_kmh number Wind speed in km/h
POST /sunrise-sunset Solar times

Calculates sunrise, sunset, solar noon, and day length for a given location and date. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
lat number Latitude
lon number Longitude
date string Date in YYYY-MM-DD format
POST /age-in-units Age calculator

Calculates age in multiple units from a birthdate. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
birthdate string Birthdate in YYYY-MM-DD format
reference_date string Optional reference date in YYYY-MM-DD format. Defaults to today.
POST /loan-payoff Amortisation calculator

Calculates loan payoff schedule including months to payoff, total interest, and total paid. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
principal number Loan principal amount
annual_rate_pct number Annual interest rate as a percentage
monthly_payment number Monthly payment amount
POST /compound-interest Compound interest calculator

Calculates compound interest with year-by-year breakdown. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
principal number Initial principal amount
annual_rate_pct number Annual interest rate as a percentage
years integer Number of years
compounds_per_year integer Number of compounding periods per year
POST /elo-rating Elo chess rating calculator

Calculates new Elo ratings after a match. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
rating_a number Current rating of player A
rating_b number Current rating of player B
outcome string Match outcome
k_factor number K-factor (default 32)
POST /password-entropy Password strength analyser

Calculates password entropy and estimated crack time. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
password string Password to analyse
POST /boiling-point Boiling point at altitude

Calculates the boiling point of water at a given altitude. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
altitude_m number Altitude in metres (0-10000)
POST /horizon-distance Horizon distance calculator

Calculates the distance to the geometric and radio horizons from a given height. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
height_m number Height in metres (positive)
POST /speed-of-sound Speed of sound calculator

Calculates the speed of sound in a given medium at a given temperature. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription

Request body

FieldTypeRequiredDescription
temp_c number Temperature in Celsius
medium string Medium for sound propagation
POST /domain-intelligence/dns DNS lookup for a domain

Returns A, AAAA, MX, TXT, NS records and derived signals: spf_present, dmarc_present, mx_count. Cost: 1 credit per call. Provide Idempotency-Key to retry safely.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Unique key per request. Retry with the same key without double-charging.

Request body

FieldTypeRequiredDescription
domain string Domain name to look up
POST /domain-intelligence/whois WHOIS / RDAP lookup for a domain

Returns registrar, registration date, expiry date, domain age in days, and days until expiry. Uses RDAP with WHOIS fallback. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Unique key per request. Retry with the same key without double-charging.

Request body

FieldTypeRequiredDescription
domain string Domain name to look up
POST /domain-intelligence/http HTTP probe — status, redirects, content type, response time

Follows redirects (max 10), records the full chain, and returns final status code, content type, and response time in ms. Only http/https URLs to public hosts are accepted. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Unique key per request. Retry with the same key without double-charging.

Request body

FieldTypeRequiredDescription
url string URL to probe. Must be http or https. Private/loopback IPs are rejected.
POST /domain-intelligence/ssl TLS/SSL certificate inspection

Inspects the TLS certificate for a domain: validity, expiry date, days remaining, issuer, SANs, and hostname match. Cost: 1 credit per call.

Parameters

NameInTypeRequiredDescription
Idempotency-Key header string Unique key per request. Retry with the same key without double-charging.

Request body

FieldTypeRequiredDescription
domain string Domain to inspect. Do not include https://.