Ollama APIollama.com ↗
Search Ollama's model library, retrieve model details, and list all tags/variants with context windows, file sizes, and pull commands via 3 REST endpoints.
What is the Ollama API?
The Ollama API exposes 3 endpoints for searching and inspecting AI models hosted on ollama.com. search_models returns a filterable list of models including capabilities, parameter sizes, and download counts. get_model_detail returns per-model metadata such as run and pull commands. get_model_tags returns every variant for a given model, including context window length, file size, and hash.
curl -X GET 'https://api.parse.bot/scraper/f1555b97-c36d-48d9-b657-60146faa21e9/search_models?sort=popular&query=deepseek&capability=cloud' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace ollama-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Ollama Model Library SDK — search, inspect, and compare AI models."""
from parse_apis.ollama_model_library_api import Ollama, Sort, Capability, ModelNotFound
client = Ollama()
# Search for vision-capable models, sorted by popularity
for model in client.modelsummaries.search(query="", capability=Capability.VISION, sort=Sort.POPULAR, limit=3):
print(model.name, model.pull_count, model.capabilities)
# Drill into one model's full detail via the summary → detail navigation
summary = client.modelsummaries.search(query="deepseek", sort=Sort.POPULAR, limit=1).first()
if summary:
detail = summary.details()
print(detail.title, detail.download_count, detail.sizes)
# List tags/variants for a model using the sub-resource
variants = client.modelsummary(slug="deepseek-r1")
for tag in variants.tags.list(limit=5):
print(tag.full_name, tag.size, tag.context)
# Direct model lookup by name
try:
model = client.models.get(model_name="deepseek-r1")
print(model.title, model.download_count, model.run_command)
except ModelNotFound as exc:
print(f"Model not found: {exc.model_name}")
print("exercised: modelsummaries.search / summary.details / tags.list / models.get")
Search for models on Ollama by keyword, with optional capability filters and sorting. Returns a list of matching models with descriptions, capabilities, available sizes, download counts, and pull commands. Combining sort=newest with a capability filter may return fewer results than sort=popular.
| Param | Type | Description |
|---|---|---|
| sort | string | Sort order: 'popular' or 'newest' |
| query | string | Search keyword (e.g., 'deepseek', 'qwen3', 'gemma') |
| capability | string | Filter by capability: 'cloud', 'embedding', 'vision', 'tools', 'thinking'. Empty string means no filter. |
{
"type": "object",
"fields": {
"sort": "string, the sort order used",
"query": "string, the search keyword used",
"models": "array of model objects with name, slug, description, capabilities, sizes, pull_count, tag_count, updated, pull_command",
"total_results": "integer, number of models returned",
"capability_filter": "string, the capability filter applied"
},
"sample": {
"data": {
"sort": "popular",
"query": "deepseek",
"models": [
{
"name": "deepseek-r1",
"slug": "deepseek-r1",
"sizes": [
"1.5b",
"7b",
"8b",
"14b",
"32b",
"70b",
"671b"
],
"updated": "11 months ago",
"tag_count": "35",
"pull_count": "87.3M",
"description": "DeepSeek-R1 is a family of open reasoning models with performance approaching that of leading models.",
"capabilities": [
"tools",
"thinking"
],
"pull_command": "ollama pull deepseek-r1"
}
],
"total_results": 15,
"capability_filter": ""
},
"status": "success"
}
}About the Ollama API
What the API covers
The Ollama API gives programmatic access to the model library at ollama.com. Three endpoints cover the full discovery workflow: searching the catalog, reading per-model metadata, and enumerating every tagged variant. Response fields include capabilities (values like thinking, tools, vision, embedding), formatted download_count, pull_command, run_command, and relative updated timestamps.
Searching and filtering models
search_models accepts a free-text query (e.g. deepseek, qwen3, gemma), an optional capability filter, and a sort parameter of either popular or newest. The response includes a models array where each object carries the model slug, description, sizes (parameter counts like 1.5b, 7b, 70b), tag_count, pull_count, and a ready-to-paste pull_command. Note that combining sort=newest with a capability filter can reduce result counts compared to using either alone.
Model detail and tags
get_model_detail takes a model_name slug and returns the full display title, description, capabilities array, all available sizes, and both pull_command and run_command strings — useful for automating local setup scripts. For finer-grained variant data, get_model_tags returns a tags array where each entry includes the exact tag, full_name, size (on-disk file size), context (context window length), input_type, hash, and pull_command. total_tags gives the count of all variants for that model.
The Ollama API is a managed, monitored endpoint for ollama.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when ollama.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official ollama.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a model selection UI that filters ollama.com models by capability (e.g.
vision,tools) and sorts by popularity - Automate local LLM setup scripts by pulling
pull_commandandrun_commandfromget_model_detail - Compare context window sizes across all variants of a model using
contextfields fromget_model_tags - Track newly published models by polling
search_modelswithsort=newest - Build a model size calculator by aggregating
sizefields fromget_model_tagsto estimate disk requirements - Generate a changelog or catalog of available embedding models by filtering
search_modelswithcapability=embedding - Identify the most-downloaded models in a category using
pull_countfromsearch_modelsresults
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Ollama have an official developer API?+
What does `get_model_tags` return beyond what `get_model_detail` provides?+
get_model_detail returns aggregate metadata: display title, description, all available parameter sizes, total download count, and pull/run commands. get_model_tags goes per-variant: each tag object includes the exact tag string, on-disk size, context window length, input_type, and a hash for integrity checking. Use get_model_tags when you need to differentiate between, for example, a q4_0 and q8_0 quantization of the same model.Are user reviews, community comments, or model benchmark scores available?+
Is there pagination support for `search_models` results?+
total_results count reflecting how many models matched, but there is no page or offset parameter exposed. All matching results for the query are returned in a single response. If you need to paginate across the full catalog, you can fork this API on Parse and revise it to add offset or cursor parameters.Does the `capability` filter in `search_models` affect result counts?+
capability_filter field in the response confirms what filter was applied. Combining sort=newest with a capability filter (e.g. capability=thinking) tends to return fewer results than using sort=popular with the same filter, because not all recently added models carry every capability tag. Omitting the capability field returns the full unfiltered set for the given query and sort.