{"id":45961256,"url":"https://github.com/rdapapi/rdapapi-php","last_synced_at":"2026-04-24T23:01:52.688Z","repository":{"id":340635459,"uuid":"1166931745","full_name":"rdapapi/rdapapi-php","owner":"rdapapi","description":"Official PHP SDK for the RDAP API","archived":false,"fork":false,"pushed_at":"2026-03-17T13:05:11.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-18T02:57:13.036Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdapapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-25T19:08:53.000Z","updated_at":"2026-03-17T12:57:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rdapapi/rdapapi-php","commit_stats":null,"previous_names":["rdapapi/rdapapi-php"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rdapapi/rdapapi-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdapapi%2Frdapapi-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdapapi%2Frdapapi-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdapapi%2Frdapapi-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdapapi%2Frdapapi-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdapapi","download_url":"https://codeload.github.com/rdapapi/rdapapi-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdapapi%2Frdapapi-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32243803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-28T13:50:07.325Z","updated_at":"2026-04-24T23:01:52.682Z","avatar_url":"https://github.com/rdapapi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rdapapi-php\n\nOfficial PHP SDK for the [RDAP API](https://rdapapi.io) — look up domains, IP addresses, ASNs, nameservers, and entities via the RDAP protocol.\n\n[![Packagist Version](https://img.shields.io/packagist/v/rdapapi/rdapapi-php.svg)](https://packagist.org/packages/rdapapi/rdapapi-php)\n[![PHP Version](https://img.shields.io/packagist/php-v/rdapapi/rdapapi-php.svg)](https://packagist.org/packages/rdapapi/rdapapi-php)\n[![CI](https://github.com/rdapapi/rdapapi-php/actions/workflows/ci.yml/badge.svg)](https://github.com/rdapapi/rdapapi-php/actions/workflows/ci.yml)\n\n## Installation\n\n```bash\ncomposer require rdapapi/rdapapi-php\n```\n\nRequires PHP 8.2 or later.\n\n## Quick Start\n\n```php\n\u003c?php\n\nuse RdapApi\\RdapApi;\n\n$api = new RdapApi('your-api-key');\n\n$domain = $api-\u003edomain('google.com');\n\necho $domain-\u003eregistrar-\u003ename;     // \"MarkMonitor Inc.\"\necho $domain-\u003edates-\u003eregistered;   // \"1997-09-15T04:00:00Z\"\necho $domain-\u003edates-\u003eexpires;      // \"2028-09-14T04:00:00Z\"\nprint_r($domain-\u003enameservers);     // [\"ns1.google.com\", ...]\n```\n\n## Usage\n\n### Configuration\n\n```php\nuse RdapApi\\RdapApi;\n\n// Default configuration\n$api = new RdapApi('your-api-key');\n\n// Custom timeout (in seconds)\n$api = new RdapApi('your-api-key', ['timeout' =\u003e 10]);\n\n// Custom base URL\n$api = new RdapApi('your-api-key', ['base_url' =\u003e 'https://custom.api.com/v1']);\n```\n\n### Domain Lookup\n\n```php\n$domain = $api-\u003edomain('example.com');\necho $domain-\u003edomain;              // \"example.com\"\necho $domain-\u003eregistrar-\u003ename;     // Registrar name\necho $domain-\u003eregistrar-\u003eiana_id;  // IANA registrar ID\necho $domain-\u003ednssec;              // true/false\n\n// With registrar follow-through (for thin registries)\n$domain = $api-\u003edomain('example.com', ['follow' =\u003e true]);\necho $domain-\u003emeta-\u003efollowed;      // true\n```\n\n### IP Address Lookup\n\n```php\n$ip = $api-\u003eip('8.8.8.8');\necho $ip-\u003ename;            // \"LVLT-GOGL-8-8-8\"\necho $ip-\u003ecountry;         // \"US\"\nprint_r($ip-\u003ecidr);        // [\"8.8.8.0/24\"]\necho $ip-\u003estart_address;   // \"8.8.8.0\"\necho $ip-\u003eend_address;     // \"8.8.8.255\"\n```\n\n### ASN Lookup\n\n```php\n$asn = $api-\u003easn(15169);           // integer\n$asn = $api-\u003easn('AS15169');       // string with prefix (stripped automatically)\n\necho $asn-\u003ename;           // \"GOOGLE\"\necho $asn-\u003estart_autnum;   // 15169\n```\n\n### Nameserver Lookup\n\n```php\n$ns = $api-\u003enameserver('ns1.google.com');\necho $ns-\u003eldh_name;                // \"ns1.google.com\"\nprint_r($ns-\u003eip_addresses-\u003ev4);   // [\"216.239.32.10\"]\nprint_r($ns-\u003eip_addresses-\u003ev6);   // [\"2001:4860:4802:32::a\"]\n```\n\n### Entity Lookup\n\n```php\n$entity = $api-\u003eentity('GOGL');\necho $entity-\u003ename;                    // \"Google LLC\"\necho $entity-\u003eorganization;            // \"Google LLC\"\necho $entity-\u003eautnums[0]-\u003ehandle;     // \"AS15169\"\necho $entity-\u003enetworks[0]-\u003ecidr[0];   // \"8.8.8.0/24\"\n```\n\n### Bulk Domain Lookup\n\nRequires a Pro or Business plan. Up to 10 domains per call.\n\n```php\n$resp = $api-\u003ebulkDomains(\n    ['google.com', 'github.com', 'example.com'],\n    ['follow' =\u003e true],\n);\n\necho $resp-\u003esummary-\u003etotal;        // 3\necho $resp-\u003esummary-\u003esuccessful;   // 3\n\nforeach ($resp-\u003eresults as $result) {\n    if ($result-\u003estatus === 'success') {\n        echo \"{$result-\u003edomain} — {$result-\u003edata-\u003eregistrar-\u003ename}\\n\";\n    } else {\n        echo \"{$result-\u003edomain} — error: {$result-\u003emessage}\\n\";\n    }\n}\n```\n\n## Supported TLDs Catalog\n\nList every TLD the API can resolve, with the date support was added and a qualitative summary of which fields the registry's RDAP server populates. Does not count against your monthly quota.\n\n```php\n$tlds = $api-\u003etlds();\nif ($tlds !== null) {\n    echo \"{$tlds-\u003emeta-\u003ecount} TLDs, coverage \".round($tlds-\u003emeta-\u003ecoverage * 100).\"%\\n\";\n\n    foreach ($tlds-\u003edata as $tld) {\n        $availability = $tld-\u003efield_availability;\n        if ($availability !== null) {\n            echo \"{$tld-\u003etld}: expires_at={$availability-\u003eexpires_at}\\n\";\n        }\n    }\n}\n```\n\nFilter to recent additions or to a single registry:\n\n```php\n$recent = $api-\u003etlds(['since' =\u003e '2026-04-01T00:00:00Z']);\n$verisign = $api-\u003etlds(['server' =\u003e 'rdap.verisign.com']);\n```\n\nPass back the previous `etag` to skip the transfer when nothing has changed:\n\n```php\n$first = $api-\u003etlds();\n$later = $api-\u003etlds(['if_none_match' =\u003e $first?-\u003eetag ?? '']);\nif ($later === null) {\n    echo \"No change since last poll\\n\";\n}\n```\n\nLook up a single TLD:\n\n```php\n$com = $api-\u003etld('com');\necho $com-\u003edata-\u003erdap_server_host; // \"rdap.verisign.com\"\n```\n\n## Error Handling\n\nAll API errors are thrown as typed exceptions that extend `RdapApiException`:\n\n```php\nuse RdapApi\\Exceptions\\AuthenticationException;\nuse RdapApi\\Exceptions\\NotFoundException;\nuse RdapApi\\Exceptions\\NotSupportedException;\nuse RdapApi\\Exceptions\\RateLimitException;\nuse RdapApi\\Exceptions\\SubscriptionRequiredException;\n\ntry {\n    $domain = $api-\u003edomain('example.nope');\n} catch (NotSupportedException $e) {\n    // Catch before NotFoundException: it's a subclass.\n    echo 'The TLD is not covered by RDAP.';\n} catch (NotFoundException $e) {\n    echo 'The domain is not registered.';\n} catch (RateLimitException $e) {\n    echo \"Rate limited, retry after {$e-\u003eretryAfter} seconds\";\n} catch (AuthenticationException $e) {\n    echo 'Invalid API key';\n} catch (SubscriptionRequiredException $e) {\n    echo 'Subscription required';\n}\n```\n\n`NotSupportedException` extends `NotFoundException`, so catching `NotFoundException` still handles both cases.\n\n| Exception | HTTP Status | Description |\n|---|---|---|\n| `ValidationException` | 400 | Invalid input |\n| `AuthenticationException` | 401 | Invalid or missing API key |\n| `SubscriptionRequiredException` | 403 | No active subscription |\n| `NotFoundException` | 404 | Namespace is covered but no record exists |\n| `NotSupportedException` | 404 | Namespace (TLD, IP range, ASN range) is not covered by RDAP |\n| `RateLimitException` | 429 | Rate limit or quota exceeded |\n| `UpstreamException` | 502 | Upstream RDAP server failure |\n| `TemporarilyUnavailableException` | 503 | Domain data temporarily unavailable |\n\nAll exceptions expose `statusCode`, `errorCode`, and `getMessage()`. `RateLimitException` and `TemporarilyUnavailableException` also have `retryAfter` (int or null).\n\n## Nullable Fields\n\nFields that may be absent in API responses use nullable types (`?string`, `?int`). Check for null before using:\n\n```php\nif ($domain-\u003edates-\u003eexpires !== null) {\n    echo \"Expires: {$domain-\u003edates-\u003eexpires}\";\n}\n\n// Or use PHP 8's nullsafe operator\necho $domain-\u003eentities-\u003eregistrant?-\u003ename;\n```\n\n## Development\n\nSet up pre-commit hooks (runs lint + tests before each commit):\n\n```bash\ngit config core.hooksPath .githooks\n```\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdapapi%2Frdapapi-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdapapi%2Frdapapi-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdapapi%2Frdapapi-php/lists"}