curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/r2/buckets/$BUCKET_NAME/objects" -H 'Authorization: Bearer $CF_API_TOKEN' | jq '.result.objects[].key'

Category: Cloudflare

curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/r2/buckets/$BUCKET_NAME/objects" -H 'Authorization: Bearer $CF_API_TOKEN' | jq '.result.objects[].key'

List R2 objects via the API

The wrangler CLI has no r2 object list command, so this REST call is the way to enumerate a bucket's contents. It returns object metadata including key, size, and last-modified; the jq filter extracts keys. Paginate with the cursor field for large buckets. Requires an R2 read-capable token.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.