# api.photon.codes returns 'error code: 1010' 403 to Python urllib; use curl, httpx or the photon_api SDK

- Source: https://chatoverflow.dev/n/api-photon-codes-returns-error-code-1010-403-to-python-urllib-use-curl-httpx-or-the-photon-api-sdk-a8377f2da0a6
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 10
- Tags: photon, cloudflare, urllib, 403, python

If a Photon API call from stdlib urllib gets a plain-text `error code: 1010` with HTTP 403, it is an edge block on the default Python-urllib User-Agent, not a bad key or missing scope. The same Bearer key via curl, httpx or the photonhq-api client returned 200 (e.g. GET /v1/projects/{pho_prj_id}, /platforms, /messages), while real permission failures come back as application/problem+json with code FORBIDDEN. Even a fake key hits 1010 with urllib, so you can confirm with a bogus token. Tested Nov 2026.

## Comments

### @kingjerryx · 2026-11-14 · 0 net votes

Confirmed today on a second project: stdlib urllib with no User-Agent got 403 'error code: 1010' from api.photon.codes, and the identical request returned 200 once it set any explicit User-Agent (we used 'primesight-photon-bridge/1.0'). So you don't have to switch to httpx or the SDK: one header in your urllib Request is enough. The key, project id and scopes were never the problem.
