PHP WHOIS library: domain availability, registration data, alternatives and prices from the Interweb Angola API https://docs.interweb.ao
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-28 09:44:34 +02:00
.github Add CI workflow and Dependabot 2026-11-28 09:17:07 +02:00
examples Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
src Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
tests Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
.gitignore Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
autoload.php Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
CHANGELOG.md Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
composer.json Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
LICENSE Initial release (1.0.0) 2026-11-27 22:29:25 +02:00
README.md Add badges and improve description 2026-11-28 09:44:34 +02:00
README.pt.md Add badges and improve description 2026-11-28 09:44:34 +02:00
repo.json Add badges and improve description 2026-11-28 09:44:34 +02:00

PHP WHOIS for Interweb Angola

CI Release License: MIT

A small PHP library for the free WHOIS of the Interweb Angola API. Ask whether a domain is free or registered, when it expires, its nameservers, what it costs to register, and which similar names are free.

Português

Install

composer require interweb-ao/php-whois

PHP 7.4 or newer with the json extension. No other packages. It uses cURL when it is there, and PHP streams when it is not. Without Composer, require the autoload.php of this package.

Get started

use InterwebAo\Whois\Client;

$whois = new Client();
$result = $whois->lookup('example.co.ao');

if ($result->isAvailable()) {
    echo 'Free for ' . $result->registerPrice() . ' ' . $result->currency() . ' a year: ' . $result->registerUrl();
} elseif ($result->isRegistered()) {
    echo 'Registered until ' . $result->expiresAt()->format('d/m/Y');
}

No key is needed: you get 60 lookups per hour per IP. With an API key of your account, Sandbox or Production, you get 1,000 per hour per account (resellers: 10,000). Create one in the API Center of Meu Interweb, then pass it or set the INTERWEB_API_KEY environment variable:

$whois = new Client(['api_key' => getenv('INTERWEB_API_KEY')]); // the same as new Client() when the variable is set

What the result gives you

Method What it returns
status() available, registered, unknown or not_allowed
isAvailable(), isRegistered() true or false
expiresAt(), createdAt(), updatedAt() DateTimeImmutable or null
daysUntilExpiry(), nameservers(), domainStatus() days, list of nameservers, list of statuses
registration(), contacts() all registration data, and the contacts the registry publishes
registerPrice($years), renewPrice($years), transferPrice() the price, or null
currency(), isPremium(), quoteRequired() the currency, short premium names, names that need a quote
alternatives() up to 4 free names, each with domain, price and register_url
registerUrl(), transferUrl() the page to register a free name or transfer a registered one
toArray(), get('field') everything the API sent

More

Several domains in one request (up to 10, each counts 1 in the limit):

foreach ($whois->lookupMany(['example.co.ao', 'mycompany.co.ao']) as $domain => $r) {
    echo $domain . ': ' . ($r->isError() ? $r->error()['message'] : $r->status()) . PHP_EOL;
}

Prices in another currency of the brand, and website links in Portuguese:

$whois = new Client(['currency' => 'USD', 'language' => 'pt']);   // for every lookup
$whois->lookup('example.co.ao', ['currency' => 'USD']);        // or only for this one

Errors are exceptions you can catch:

use InterwebAo\Whois\Exception\RateLimitException;
use InterwebAo\Whois\Exception\ValidationException;
use InterwebAo\Whois\Exception\WhoisException;

try {
    $r = $whois->lookup('example.invalid');
} catch (ValidationException $e) {
    echo $e->getReason();      // extension_not_supported: an extension we do not sell
} catch (RateLimitException $e) {
    echo $e->getRetryAfter();  // seconds to wait
} catch (WhoisException $e) {
    echo $e->getMessage();     // anything else; getCorrelationId() helps support
}

Options of new Client([...]): api_key, currency, language (pt or en), timeout (15 seconds), retries (1, only on network errors and 5xx) and user_agent.

Tests

php tests/run.php          # offline, no network
php tests/live.php example.co.ao   # real lookups, uses your hourly limit

The WHOIS API docs: https://docs.interweb.ao/whois/

Domain extensions (500)

From Angola: .ao, .co.ao, .edu.ao, .org.ao, .it.ao

Most popular: .com, .net, .org, .info, .biz, .co, .io, .ai, .me, .tv, .app, .dev, .online, .store, .site, .shop, .tech, .xyz, .cloud, .pro

All others: .abogado, .ac, .ac.mz, .academy, .accountant, .accountants, .actor, .ad, .adult, .adv.mz, .africa.com, .agency, .airforce, .apartments, .archi, .army, .art, .asia, .associates, .attorney, .auction, .audio, .auto, .autos, .baby, .band, .bar, .barcelona, .bargains, .beauty, .beer, .berlin, .best, .bet, .bike, .bingo, .bio, .black, .blackfriday, .blog, .blue, .boats, .bond, .boo, .boston, .bot, .boutique, .broker, .build, .builders, .business, .buzz, .ca, .cab, .cafe, .cam, .camera, .camp, .capetown, .capital, .car, .cards, .care, .career, .careers, .cars, .casa, .cash, .casino, .cat, .catering, .cc, .center, .ceo, .cfd, .channel, .charity, .chat, .cheap, .christmas, .church, .city, .claims, .cleaning, .click, .clinic, .clothing, .club, .co.mz, .co.uk, .co.za, .coach, .codes, .coffee, .college, .community, .company, .compare, .computer, .condos, .construction, .consulting, .contact, .contractors, .cooking, .cool, .country, .coupons, .courses, .credit, .creditcard, .cricket, .cruises, .cv, .cymru, .cyou, .dad, .dance, .date, .dating, .day, .de, .deal, .dealer, .deals, .degree, .delivery, .democrat, .dental, .dentist, .design, .diamonds, .diet, .digital, .direct, .directory, .discount, .diy, .doctor, .dog, .domains, .download, .durban, .eat, .eco, .edu.mz, .education, .email, .energy, .engineer, .engineering, .enterprises, .equipment, .es, .esq, .estate, .eu, .events, .exchange, .expert, .exposed, .express, .fail, .faith, .family, .fan, .fans, .farm, .fashion, .fast, .feedback, .finance, .financial, .fish, .fishing, .fit, .fitness, .flights, .florist, .flowers, .fly, .fm, .foo, .food, .football, .forex, .forsale, .forum, .foundation, .free, .fun, .fund, .furniture, .futbol, .fyi, .gallery, .game, .games, .garden, .gay, .gg, .gifts, .gives, .giving, .glass, .global, .gmbh, .gold, .golf, .gov.mz, .graphics, .gratis, .green, .gripe, .group, .guide, .guitars, .guru, .hair, .haus, .health, .healthcare, .help, .here, .hiphop, .hiv, .hockey, .holdings, .holiday, .homes, .horse, .hospital, .host, .hosting, .hot, .house, .how, .icu, .id, .im, .immo, .immobilien, .in, .inc, .industries, .ing, .ink, .institute, .insure, .international, .investments, .irish, .je, .jetzt, .jewelry, .kaufen, .kids, .kim, .kitchen, .land, .lat, .latino, .law, .lawyer, .lease, .legal, .lgbt, .life, .lifestyle, .lighting, .limited, .limo, .link, .live, .living, .llc, .loan, .loans, .locker, .lol, .london, .lotto, .love, .ltd, .luxe, .luxury, .maison, .makeup, .management, .market, .marketing, .markets, .mba, .media, .meme, .memorial, .men, .miami, .mil.mz, .mobi, .mobile, .moda, .mom, .money, .monster, .mortgage, .motorcycles, .mov, .movie, .music, .my, .navy, .net.mz, .network, .new, .news, .nexus, .ninja, .now, .nyc, .observer, .one, .ong, .org.mz, .page, .partners, .parts, .party, .pet, .phd, .photo, .photography, .photos, .pics, .pictures, .pink, .pizza, .place, .plumbing, .plus, .poker, .porn, .press, .productions, .prof, .promo, .properties, .property, .protection, .pub, .pw, .quest, .racing, .realty, .recipes, .red, .rehab, .reise, .reisen, .rent, .rentals, .repair, .report, .republican, .rest, .restaurant, .review, .reviews, .rip, .rocks, .rodeo, .rsvp, .run, .sale, .salon, .sarl, .sbs, .school, .schule, .science, .security, .select, .services, .sex, .sexy, .sh, .shiksha, .shoes, .shopping, .show, .si, .singles, .ski, .skin, .soccer, .social, .software, .solar, .solutions, .soy, .space, .spot, .storage, .stream, .studio, .study, .style, .supplies, .supply, .support, .surf, .surgery, .systems, .talk, .tattoo, .tax, .taxi, .team, .technology, .tel, .tennis, .theater, .theatre, .tickets, .tienda, .tips, .tires, .to, .today, .tools, .top, .tours, .town, .toys, .trade, .trading, .training, .tube, .uk, .university, .uno, .us, .vacations, .vana, .ventures, .vet, .viajes, .video, .villas, .vin, .vip, .vision, .vodka, .vote, .voto, .voyage, .wales, .watch, .webcam, .website, .wedding, .wiki, .win, .wine, .work, .works, .world, .wtf, .xxx, .yachts, .yoga, .you, .za.com, .zip, .zone

License

MIT. See LICENSE.


Maintained by RLX Holdings.