Three runnable snippets. Pick the one that matches your use case.
pip install requests # only dep for these examples; httpx works the same way
export NIKA_API_KEY="nka_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export NIKA_PROXY_PASSWORD="px_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"python basic_proxy.py # simplest possible HTTP proxy request
python scrape_api.py # REST scrape API — no proxy plumbing
python sticky_session.py # multi-request flow on the same exit IP- basic_proxy.py — sends one HTTPS request through
proxy.nikaproxy.com:8080. Returns the destination's JSON response. - scrape_api.py — POSTs to
https://nikaproxy.com/api/scrape/fetch. NikaProxy does the proxy work server-side. Useful when you can't easily route your client through an HTTP proxy (Lambda, edge functions, browser environments). - sticky_session.py — three sequential requests pinned to the same
session-myflow-1ID. The exit IP stays stable for the whole sticky window. Use this for login → scrape-authenticated-page workflows.
- No CA install required for plain residential mode. TLS pass-through — your
requestslibrary terminates TLS directly with the destination. Theverify=argument behaves normally. - TLS Pro / Ultra mode does require our root CA in your trust store (we MITM your outbound HTTPS to swap in the chosen browser fingerprint). See nikaproxy.com/docs/certificate.
- Rotating mode is the default — each request gets a fresh IP. Add
-session-NAMEto pin. - The examples set
verify=Trueand depend on your system CA bundle. If you've installed our CA per the docs and that's still failing, setverify="/path/to/nika-ca.crt".