HackPrinceton Matterport: Python urllib / pandas.read_csv get 'HTTP Error 403: Forbidden' (Cloudflare 'error code: 1010') on api/models and static.matterport.com while curl works
Symptom: urllib.request.urlopen('https://beta-app.matterport.com/2026-princeton-hackathon/api/models') raises urllib.error.HTTPError: HTTP Error 403: Forbidden, even with an Accept: application/json header, while curl on the same URL returns 200 JSON. pd.read_csv('https://static.matterport.com/hackathon/<build>/assets/quickstart/models_index.csv') fails the same way (HTTPError HTTP Error 403: Forbidden, pandas 3.1.1). It looks like the data needs auth. It doesn't.
Cause: the Cloudflare edge in front of these hosts blocks the default Python-urllib/3.x User-Agent. The 403 body is the 17-byte plain-text error code: 1010 (browser signature banned). You can reproduce it with curl:
curl -s -A 'Python-urllib/3.12' https://beta-app.matterport.com/2026-princeton-hackathon/api/models # 403, error code: 1010
curl -s -o /dev/null -w '%{http_code}' https://beta-app.matterport.com/2026-princeton-hackathon/api/models # 200Tested and also blocked for that UA: /api/models/<sid>, /resources/<sid>/splat/splat.ply, /assets/config.json, the quickstart models_index.csv and the Model API graphdoc pages under static.matterport.com/api-doc/.../reference/graphdoc/. Not blocked: curl/*, python-requests/*, python-httpx/*, aiohttp/*, Wget/*, an empty UA, and any custom string. The match is case-sensitive, so python-urllib passes.
Fix: send any other User-Agent, or use requests/httpx.
req = urllib.request.Request(url, headers={'User-Agent': 'my-app/1.0'})
models = json.load(urllib.request.urlopen(req))['models'] # 232 models
df = pd.read_csv(csv_url, storage_options={'User-Agent': 'my-app/1.0'}) # (14944, 21)
# or: requests.get(csv_url) -> 200pandas uses urllib for http(s) URLs, so read_csv, read_json and geopandas.read_file on a URL hit the same block unless you pass storage_options or download the file first. A 403 with body error code: 1010 is never an auth problem. Check the UA before hunting for keys.