Actions17
- Bucket Actions
- Object Actions
- Batch Operations Actions
Object → Search
AI-generatedSummary
Searches for objects in an R2 bucket by filename pattern, extension, or containment.
Inputs
- bucketName (required) — Name of the R2 bucket to search within.
- searchOptions — Options controlling the search, including filename contains, extension, pattern, prefix, and result limits.
Output shape
An object containing an array of matching objects, search criteria, pagination flags, and result counts.
The returned object includes
objects(matched files),search_criteria,total_searched, andresults_count. Pagination fields liketruncatedmay be present.
Examples
Example 1: Find all PDF invoices in a bucket
bucketName: invoices, searchOptions: {"fileExtension": "pdf", "contains": "invoice"}
Example 2: List up to 200 images matching a wildcard pattern
bucketName: images, searchOptions: {"pattern": "*.jpg", "maxResults": 200}