Getting Started

API Documentation

CodePunch provides three REST API data feeds. All share the same authentication mechanism and return JSON responses. Choose a feed from the sidebar to see its endpoints and parameters.

Domain Activity https://api.codepunch.com/dnfeed/v2
DNS and Subdomains https://api.codepunch.com/dns/v2
SSL/TLS Certificates https://api.codepunch.com/tlscerts/v2

These APIs are intended for integration into your own applications and pipelines. If you are not sure how to make HTTP requests from code, see the code samples for working Python and PHP examples.

Authentication

All three APIs use a two-step token-based authentication. Your subscription comes with an API key and an API secret. You first exchange these for a session token, then include the token in every subsequent request as a path parameter.

Step 1: Get a token

GET /auth/{apikey}/{apisecret}

Replace {apikey} and {apisecret} with your credentials. The response contains your session token:

# Example
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.

# Token goes in the path, not a header
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

All list endpoints return paginated results. Use start and limit to page through data. The response always includes a records field with the total result count. Keep the same sorton value across all pages to ensure consistent ordering.

start integer

Starting index. Default 0, maximum 1,000,000. Use keyword filters to narrow results if the total exceeds 1,000,000.

limit integer

Records per page. Default 500, maximum 5000.

# Page 1
GET .../added?start=0&limit=500

# Page 2
GET .../added?start=500&limit=500

Errors

All error responses return JSON with "status": false and an "error" description.

{
  "status": false,
  "error":  "Missing Token in API Request"
}
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.