ImageKit icon

ImageKit

Interact with the ImageKit API

Asset → List and Search

AI-generated

Summary

List and search assets in your ImageKit media library, optionally filtering by folder, type, and file type using a Lucene-like query string.

Inputs

  • Limit — Max number of results to return (1-1000, default 50).
  • Skip — The number of results to skip (default 0).
  • Sort By — Field to sort the results by (created, height, name, relevance, size, updated, or width, default created).
  • Sort Direction — Direction to sort the results (asc or desc, default asc).
  • Path — Folder path to limit the search within a specific folder (e.g. /sales-banner/).
  • Search Query — Lucene-like query string for advanced filtering. Overrides tags, type, and name filters when set.
  • File Type — Type of files to include in the result set (all, image, or non-image).
  • Asset Type — Type of assets to include (all, file, folder, or file-version).

Output shape

a list of items, each containing asset metadata (e.g., fileId, name, url, tags, size, etc.).

Returns a single item object when a search query returns no matches or a single result. Supports pagination via limit and skip parameters.

Examples

Example 1: List recent images from a specific folder

Set Limit to 20, Path to '/product-images/', and Asset Type to 'image'.

Example 2: Search for assets tagged with 'sale' created in the last 7 days

Set Search Query to 'createdAt > "7d" AND tags IN ["sale"]'.

Example 3: Get a paginated list of assets sorted by name in descending order

Set Sort By to 'name', Sort Direction to 'desc', and Limit to 100.

Links

Discussion