5,3 KiB
name: whois-lookup description: Look up any domain name with the free Interweb Angola WHOIS API: whether it is free or registered, expiry date, registry status, nameservers, price to register, renew or transfer at Interweb Angola, and similar free names. Works without an API key. Use when the user asks if a domain is free, who holds it, when it expires, or wants name ideas.
Interweb Angola WHOIS
Use this skill to look up domain names, even with no Interweb Angola account. To buy, use manage-domains.
Setup
- API address:
https://api.interweb.ao/v1. It is fixed for Interweb Angola: never ask the user for another address. - API key: always read it from the
INTERWEB_API_KEYenvironment variable. Check it without printing it:test -n "$INTERWEB_API_KEY" && echo set || echo missing - If it is missing, ask the user to create a key in the API Center (https://www.meu.interweb.ao/api-center.php) with any permission (the key is optional here: WHOIS also works without one, with a lower hourly limit), then to run
export INTERWEB_API_KEY="sandbox_..."and restart Claude Code (or the editor). sandbox_keys read the real account but only simulate writes and never charge.prod_keys change the account and can charge.GET /v1/tokengives the mode indata.modeand the permissions indata.permissions. Suggest asandbox_key for a first try.- Never print, log or commit the key, and never put it in code that runs in a browser or a mobile app. In code, read it from the environment.
Every request looks like this:
curl -sS "https://api.interweb.ao/v1/PATH" -H "Authorization: Bearer $INTERWEB_API_KEY" -H "Accept: application/json"
Rules
- Before anything that charges, deletes data or cannot be undone, tell the user exactly what will happen (with the price, when the API gives one) and wait for a clear yes.
- Send an
Idempotency-Keyheader on purchases, sends and other POST requests that accept it, and reuse the same value if you retry the same request:IDEM=$(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid). - Lists come in pages:
?page=1&per_page=100, andmeta.total_pagessays how many there are. - Long operations answer
202with anaction_id. Follow them withGET /v1/actions/{action_id}every 10 to 20 seconds untilstatusisdoneorfailed. - Answer the user in the language they write in, and show amounts with the currency the API returns.
Look up one name
curl -sS "https://api.interweb.ao/v1/whois/mybusiness.co.ao"
With a key, add -H "Authorization: Bearer $INTERWEB_API_KEY" (higher limit and the account currency).
status:available,registered,unknown(could not be confirmed now) ornot_allowed.- Registered:
registrationhas the dates, status, nameservers, age, days until expiry, DNSSEC and, when the registry publishes them, the contacts.transfer_urlopens the transfer on the Interweb Angola website. - Free:
register_urlopens the registration on the website.alternativessuggests up to 4 free names. pricehas the 1-year register, renew and transfer price;priceshas the price per number of years.premium: truenames have their own price;quote_required: truemeans the price comes from a quote.- Extensions we do not sell answer
422extension_not_supported.
Several names
curl -sS "https://api.interweb.ao/v1/whois?domains=mybusiness.co.ao,mybusiness.com"
Up to 10 names per request, in the order asked. A name with a problem comes with status error and the others still answer.
Currency and language
?currency=USD (any currency of the brand; otherwise 422 with the accepted list in details.allowed) and ?language=pt or en for the website links.
Limits
- Without a key: 60 lookups per hour per IP. With a key: 1,000 per hour per account.
429comes withretry_afterin seconds. Do not loop over long lists: ask the user which names matter.
Presenting the answer
Give a short answer first ("free, and costs a year to register" or "registered until "), then the details the user asked for. Personal contact data from WHOIS is only shown when the user asks for it.
Errors
Errors look like {"error": {"code", "message", "correlation_id", "details"}}. Act on code, never on the text of message.
| HTTP | code | What to do |
|---|---|---|
| 401 | unauthorized |
The key is missing, wrong or revoked. Ask the user to check INTERWEB_API_KEY. |
| 402 | insufficient_credit |
Not enough account credit, and nothing was charged. Give the user details.add_funds_url. |
| 403 | insufficient_scope |
The key lacks a permission. Name it and ask for a key that has it. |
| 403 | spending_limit_exceeded |
The purchase goes over the key spending limit. Nothing was charged. |
| 404 | not_found |
Wrong id, or it is not in this account. |
| 409 | conflict and others |
Read details.reason and explain it in plain words. |
| 422 | validation_failed |
Fix the field named in details and try again. |
| 429 | rate_limited |
Wait for the Retry-After seconds, then try once more. |
| 5xx | internal_error, upstream_error |
Try again later. If the user contacts support, give them the correlation_id. |
More
- WHOIS: https://docs.interweb.ao/whois/
- Domains: https://docs.interweb.ao/domains/
- Full reference: https://api.interweb.ao/v1/openapi.json