Search Models and Drill Into a Version
A 3-step recipe with Civitai. We can help you get access.
Recipe · 3 steps
Search Models and Drill Into a Version
with Civitai
Search models then fetch the top model and one of its versions.
- Run a keyword search across the model catalog and capture the first matching model id.
- Fetch the full detail for the first model returned by the search, including its stats, creator, tags, and version list.
- Resolve the first model version attached to the matched model so files, hashes, and the AIR identifier are available.
What you'll need to have ready
- apiKey: Civitai personal API token used as a Bearer credential.
- query: Free-text search term to match against model names and metadata.
- types: Optional model type filter (e.g. Checkpoint, LORA, Controlnet).
- sort: Sort order, one of 'Highest Rated', 'Most Downloaded', 'Newest'.
- period: Time window for ranking (AllTime, Year, Month, Week, Day).
- limit: Maximum number of models to return in the search page.
For your developer
Arazzo workflow civitai:search-models-detail, 3 operations: listModels → getModel → getModelVersion. Specs on APIs.io.