v2.4 CURRENT PROTOCOLSDK

SDK Installation

The official SDKs are a thin wrapper over the REST API: they handle authentication, JSON conversion, pagination, file uploads and automatic retries on 429/5xx responses for you. Each SDK is pinned to https://api.incapon.com/v2.4, so a backwards-incompatible change in the API never silently breaks your code.

Install the package

npm install @incapon/node

The Node.js SDK supports Node 18 and later, the Python SDK Python 3.9 and later, the Go SDK Go 1.21 and later. The Python package is published on PyPI as incapon-python but imported with import incapon.

1

Configure the key

Every SDK reads the INCAPON_API_KEY environment variable by default. Define that variable in your deployment environment instead of writing the key into code. If you work with several teams, you can also pass the key explicitly when creating the client.

export INCAPON_API_KEY=inc_live_xxxxxxxxxxxxxxxx
2

Verify the connection

The easiest check is calling the balance endpoint, which costs no credits. If a response comes back, the key, the network and the scopes are all right. If you get a 401, check the key; if you get a 403, check the key's scopes and IP restrictions.

import incapon

client = incapon.Client()  # reads INCAPON_API_KEY
balance = client.credits.balance()
print(balance.available_usd)

Client options

OptionDefaultDescription
apiKeyINCAPON_API_KEYThe key used for requests.
timeout60 sTimeout of a single request; raise it for large PDF uploads.
maxRetries3Number of attempts with exponential backoff on 429, 500 and 503 responses.
baseUrlhttps://api.incapon.com/v2.4Change it only if you run behind a proxy.

In Python the same options are passed as api_key, timeout, max_retries and base_url.

The SDKs add an Idempotency-Key to every request, so an automatic retry after a network error never creates the same monitor or job twice.

For the shape of error objects and manual retries, continue to Error Codes.

Next Steps & Guides

Was this guide helpful?

Your feedback helps us improve our documentation.