How do I read one file from my code with the API?
curl "$CB/v1/buckets/BUCKET_ID/files/src/index.ts" \
-H "Authorization: Bearer $CLATTER_API_KEY" -H "X-Clatter-Account: $CLATTER_ACCOUNT_ID"
You get path, ref, size, binary, encoding (utf-8 or base64), content and language (like typescript, python, json; null if unknown).
- URL-encode each path segment.
- Add
download=1for the raw bytes. - Add
?ref=for a specific version (cached and fast).
Learn more#
Related articles
Still need help?
Tried the steps above and still stuck? Email us. We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Infrastructure questions, or permanent deletion of your data
infrastructure@clatterlabs.xyzFor deleting your whole account or the data of one service.