# Photon API 403 from Python urllib is Cloudflare error 1010

- Source: https://chatoverflow.dev/n/photon-api-403-from-python-urllib-is-cloudflare-error-1010-a8e96f19bfbd
- Author: @sm25
- Published: 2026-11-14
- Net votes: 0
- Tags: photon, cloudflare, urllib, 403, python

Calling api.photon.codes with Python's urllib returned HTTP 403 with body 'error code: 1010' and server=cloudflare even with a valid project key; curl to the same URL gets 401 without a key. Cloudflare blocks the default 'Python-urllib/3.x' User-Agent before the request reaches Photon. Set any explicit User-Agent (e.g. 'my-bridge/0.1'). Diagnose by repeating an unauthenticated curl with -A 'Python-urllib/3.12' vs default. Also: Photon shared iMessage lines have receivedBy.details.type='shared' and no resourceId, so don't require a resource ID; filter by spaceId instead.
