# Ollama Model Library Scraper (`b2b_lead_generation/ollama-model-library-scraper`) Actor

Scrape and organize models, tags, and file sizes from the Ollama library. Search by name or filter by capabilities like vision and tools, then export your structured results as JSON, CSV, or Excel.

- **URL**: https://apify.com/b2b_lead_generation/ollama-model-library-scraper.md
- **Developed by:** [B2B Lead Generation](https://apify.com/b2b_lead_generation) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Ollama Model Library Scraper

<p align="center">
  <img src="https://imgur.com/eZOBZ1Q.png" alt="Ollama Model Library" style="max-width:100%; border-radius:14px; width:680px;" />
</p>

An easy-to-use tool designed to collect data from the open model catalog on Ollama. It helps you search models, grab details, check available tags, and inspect file sizes. You can easily export your results into spreadsheets like JSON, CSV, or Excel.

Whether you are looking up a single model or compiling a list, this tool processes requests smoothly, pauses between tasks to avoid overcrowding servers, and logs errors cleanly if a specific request fails so your whole run keeps going.

### Use cases

- **Model catalog**: Build and maintain a searchable dataset of available models, descriptions, and popularity metrics.
- **Local setup**: Verify parameter sizes, available tags, and context windows before pulling models to your local environment.
- **Capability filtering**: Quickly discover models that support specific features like tools, vision, embeddings, or reasoning.
- **Spreadsheet reporting**: Export clean datasets directly to CSV or Excel for analysis or team sharing.
- **Catalog tracking**: Run periodic checks to monitor updates, new tags, or shifts in model popularity.

### Input options

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `mode` | string | `search` | Choose between `search`, `model_details`, or `model_tags`. |
| `query` | string | `llama` | Search text to filter models. |
| `models` | array | `llama3.2` | List of specific model names for details or tags mode. |
| `capability` | string | empty | Optional filter for features like tools, thinking, vision, or embedding. |
| `order` | string | `popular` | Sort order options: popular, newest, or name. |
| `maxItems` | integer | `100` | Target number of items to collect. Max limit is 1000. |
| `requestDelaySecs` | number | `1` | Delay between requests in seconds to keep execution smooth. |
| `timeoutSecs` | integer | `300` | Overall run timeout in seconds. |
| `requestTimeoutSecs` | integer | `30` | Timeout per individual request in seconds. |
| `userAgent` | string | B2BLeadGenerationResearch/1.0 | Custom contact string sent with requests. |
| `proxyConfiguration` | object | Off | Optional proxy settings if required for your setup. |

#### Example input

```json
{
  "mode": "search",
  "query": "llama",
  "order": "popular",
  "maxItems": 100,
  "requestDelaySecs": 1,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": { "useApifyProxy": false }
}

```

### Collected data fields

The tool gathers key catalog attributes and formats them into a clean structured output:

```json
{
  "name": "llama3.1",
  "url": "[https://ollama.com/library/llama3.1](https://ollama.com/library/llama3.1)",
  "modelSummary": "Llama 3.1 is a state-of-the-art model from Meta available in 8B, 70B and 405B parameter sizes.",
  "capabilities": ["tools"],
  "sizes": ["8b", "70b", "405b"],
  "downloads": 120225507,
  "downloads_display": "120.2M",
  "source_url": "[https://ollama.com/search?q=llama](https://ollama.com/search?q=llama)",
  "scraped_at": "2026-10-12T00:00:00+00:00"
}

```

When running in tags mode, additional detail fields are populated: `tag`, `digest`, `size`, `context_window`, `input`, and `updated`.

If an error occurs while fetching a specific item, an error row is recorded without halting the execution:

```json
{
  "error": "Unknown model id",
  "url": "[https://ollama.com/library/missing-model](https://ollama.com/library/missing-model)",
  "status": 404,
  "message": "Unknown model id",
  "source_url": "[https://ollama.com/library/missing-model](https://ollama.com/library/missing-model)",
  "scraped_at": "2026-10-12T00:00:00+00:00"
}

```

| Field | Type | Description |
| --- | --- | --- |
| `name` | string | Model name identifier. |
| `url` | string | Web link to the model or tag. |
| `modelSummary` | string | Summary description of the model. |
| `capabilities` | array | Badges indicating supported capabilities (e.g., tools, vision). |
| `sizes` | array | Available parameter sizes (e.g., 8b, 70b). |
| `downloads` | integer | Numeric download count. |
| `downloads_display` | string | Formatted download count (e.g., 120.2M). |
| `tag` | string | Tag name (e.g., llama3.2:latest). |
| `digest` | string | Short hash digest. |
| `size` | string | Disk file size label (e.g., 2.0GB). |
| `context_window` | string | Maximum context length label (e.g., 128K). |
| `input` | string | Input type supported (e.g., Text). |
| `updated` | string | Time since last update. |
| `source_url` | string | Origin URL processed for the record. |
| `scraped_at` | string | Timestamp of collection in UTC. |
| `error` | string | Error label (only present on failed items). |
| `status` | integer | HTTP status code on error records. |
| `message` | string | Error detail explanation. |

### How it works

1. Reads your input configuration and initializes the workload.
2. Iterates through search results page by page (around 20 items per page), maintaining selected filter parameters.
3. Pauses briefly between actions according to `requestDelaySecs` and retries transient failures.
4. Removes duplicates by model name or tag and outputs data in structured batches until reaching `maxItems` or time limits.

### Performance considerations

This actor is focused strictly on catalog information and text summaries. It does not download model binary files or weights, ensuring fast and lightweight operations.

### FAQ

**Can I export the collected data directly to spreadsheet formats?**
Yes, results can be downloaded in JSON, CSV, or Excel formats.

**What happens if a requested model isn't found?**
The scraper logs a single error record containing the URL and error status, then seamlessly proceeds to process the remaining models.

**How many records can be collected in a single run?**
The default limit is set to 100, with a configurable cap up to 1000 items per run.

**Is a proxy necessary?**
Proxies are disabled by default and are generally not required unless you encounter IP restrictions.

### Trademark Notice

Ollama Model Library and related product names, logos, and trademarks belong to their respective owners. Their inclusion in this document is purely for descriptive purposes to identify the source dataset and does not denote endorsement or official partnership.

### Disclaimer

This Actor is an independent collection tool and is not affiliated with, endorsed by, or sponsored by Ollama Model Library or its parent entities. Users are responsible for ensuring their usage aligns with relevant terms of service, rate guidelines, and licensing terms.

### Is web scraping legal?

This Actor gathers publicly accessible data from the catalog without bypassing security mechanisms or restrictions. Gathering open data is generally permissible, but you should take standard precautions depending on your use case:

- **Personal data:** If your collected datasets ever involve personal details, ensure compliance with relevant privacy regulations like GDPR or CCPA.
- **Copyright:** Always treat underlying descriptions and text respectfully and avoid re-publishing full copyrighted materials inappropriately.
- **Terms of use:** Ensure your request frequency stays within reasonable limits and complies with standard internet guidelines.
- **Legal advice:** This overview provides general context and does not constitute formal legal counsel.

To learn more, read Apify's guide: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

# Actor input Schema

## `mode` (type: `string`):

What to scrape: a search list, one model page per name, or the tags page for each name.

## `query` (type: `string`):

Search text sent as q= on the public library search page. Leave empty to list models without a text filter.

## `models` (type: `array`):

Model names for model page and tags modes, one name per line, such as llama3.2.

## `capability` (type: `string`):

Optional search filter sent as c=. The library page offers tools, thinking, vision, embedding, decision, local, and cloud. Leave empty for all.

## `order` (type: `string`):

Search sort sent as o=. Use popular, newest, or name.

## `maxItems` (type: `integer`):

Maximum successful rows to save in one run. Hard cap is 1000.

## `requestDelaySecs` (type: `number`):

Seconds to wait between library requests so the run stays polite.

## `timeoutSecs` (type: `integer`):

Stop the run after this many seconds, even if the cap is not reached.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for a single library response before treating it as a failure.

## `userAgent` (type: `string`):

Identify your app with a contact. Sent on every request.

## `proxyConfiguration` (type: `object`):

Optional proxy for requests. Off by default. Turn it on only if the library starts refusing your IP.

## Actor input object example

```json
{
  "mode": "search",
  "query": "llama",
  "models": [
    "llama3.2"
  ],
  "capability": "",
  "order": "popular",
  "maxItems": 100,
  "requestDelaySecs": 1,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "userAgent": "BigiByteActorResearch/1.0 (contact: research@bigibyte.com)",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Rows saved from this run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "llama",
    "models": [
        "llama3.2"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("b2b_lead_generation/ollama-model-library-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "query": "llama",
    "models": ["llama3.2"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("b2b_lead_generation/ollama-model-library-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "llama",
  "models": [
    "llama3.2"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call b2b_lead_generation/ollama-model-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,b2b_lead_generation/ollama-model-library-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/re2Isen4mvBREqenh/builds/aod9mkyboZKUZv24U/openapi.json
