CodePunch API v2 Documentation
CodePunch provides three REST API data feeds. All use the same two-step authentication mechanism and return JSON responses. Start with the base URL for the data you need, then open the feed-specific reference for its endpoints and parameters.
https://api.codepunch.com/dnfeed/v2
https://api.codepunch.com/dns/v2
https://api.codepunch.com/tlscerts/v2
These APIs are intended for integration into your own applications and pipelines. For complete runnable clients, see the code samples. The feed references document the endpoints and parameters for Domain Activity, DNS and Subdomains, and SSL/TLS Certificates.
Authentication
All three APIs use two-step token-based authentication. Your subscription comes with an API key and an API secret. Exchange those credentials for a session token, then include that token in the URL path of subsequent requests.
Step 1: Get a token
Replace {apikey} and {apisecret} with your credentials. Authentication is available under each API v2 base URL. This example uses Domain Activity:
# Request GET https://api.codepunch.com/dnfeed/v2/auth/YOUR_API_KEY/YOUR_API_SECRET # Response { "status": true, "token": "a1b2c3d4e5f6..." }
Step 2: Use the token
Include the token in the path of every subsequent request in place of {token}. The token stays valid as long as your IP address does not change. Fetch a new token when you start a new session or if your IP changes.
# Example authenticated request GET https://api.codepunch.com/dnfeed/v2/a1b2c3d4e5f6/added?kw=apple&tlds=com
Do not make more than one authentication request per second. There is no need to re-authenticate on every request. Rapid auth requests from multiple IP addresses using the same credentials will be blocked.
Pagination and Count Fields
Many API v2 list/search endpoints use start and limit, but count fields and traversal rules differ by feed and endpoint. Do not assume that a field named records always means the total number of matches.
start
integer
Starting result offset where the selected endpoint supports pagination. Defaults and traversal ceilings are documented on the feed-specific reference page.
limit
integer
Requested page size where supported. Use the endpoint-specific valid range rather than assuming one global limit.
count fields
For example, Domain Activity added/deleted requests use records as the total matching row count, DNS domain searches use records for the current page and domain_records in dm=stats mode, while TLS certificate searches use records for the current page in normal mode and the matching count in dm=stats mode.
# Example: Domain Activity pagination GET .../added?start=0&limit=500 GET .../added?start=500&limit=500 # Example: DNS gTLD count, then first page GET .../domains?kw=brandname&dm=stats GET .../domains?kw=brandname&start=0&limit=500
Open the feed-specific reference before implementing pagination. It defines the count field, ordering behavior, page-size rules, and any traversal ceiling for that endpoint.
Errors
All error responses return JSON with "status": false and an "error" description.
{
"status": false,
"error": "Missing Token in API Request"
}
A TLS /certificates search with no rows can return status=false, records=0, and data=[] without an error field. TLS clients should treat an explicit error as failure rather than assuming every status=false search response is an error.
Missing Token in API Request
No token was included in the request path. Authenticate first using /auth/{apikey}/{apisecret}.
401 Unauthorized
Token is invalid or expired due to an IP address change. Re-authenticate to get a new token.
API references and samples
Use the feed-specific documentation for endpoint details and the samples page for complete client examples.
Daily added and deleted domain activity, TLD information, keyword filtering, and daily ZIP access.
DNS records, searchable gTLD and ccTLD data, nameservers, observed subdomains, and ASN lookup.
Certificate search, recent certificates, and certificate detail.
Runnable Python and PHP examples for the current API v2 endpoints.