# Civitai Scraper (`zucchini_gopher_m2v/civitai-scraper`) Actor

Search and extract Civitai AI model listings, full model/download details, image gallery posts, creators, and tags -- no account or API key needed.

- **URL**: https://apify.com/zucchini\_gopher\_m2v/civitai-scraper.md
- **Developed by:** [Faisal Ahdan naufal](https://apify.com/zucchini_gopher_m2v) (community)
- **Categories:** AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Civitai Scraper

Search and extract Civitai AI model listings, full model/download details, image gallery posts, creators, and tags — no account or API key needed.

### Why use this actor

- One actor covers Civitai's whole public surface: search models, pull full download-ready details for specific models, browse the image gallery, and list creators/tags
- Full model detail includes every version's file list — direct download URLs, file hashes (SHA256, BLAKE3, AutoV2...), virus/pickle-scan results, and base model — everything you need to build a model catalog or mirror
- No account, login, or API key required — this actor talks to Civitai's own official public REST API
- Automatic retries on temporary network hiccups
- Robust pagination — automatically follows Civitai's cursor/page links up to the limit you set, instead of returning just one page
- Honest about limits: `modelId` image filtering is fixed to work correctly even though Civitai's own API silently returns nothing for it (see Known limits) — and generation prompt metadata is never available publicly, which is stated plainly rather than faked

### How it works

Pick a `mode`:

1. **`models`** — search/browse AI models (checkpoints, LoRAs, embeddings, etc.) with filters for query text, tag, username, type, sort order, and time window.
2. **`model-detail`** — fetch full detail (every version, every file, every download URL) for one or more specific model IDs.
3. **`images`** — browse the image gallery, optionally filtered by model, model version, username, or post.
4. **`creators`** — list or search usernames.
5. **`tags`** — list or search tags.

### Input

**Search models:**

```json
{
  "mode": "models",
  "query": "pony",
  "types": ["Checkpoint"],
  "sort": "Most Downloaded",
  "period": "AllTime",
  "maxItems": 50
}
```

**Model detail (by ID):**

```json
{
  "mode": "model-detail",
  "modelIds": ["4201", "257749"]
}
```

**Images:**

```json
{
  "mode": "images",
  "modelId": 4201,
  "sort": "Most Reactions",
  "maxItems": 50
}
```

**Creators / Tags:**

```json
{ "mode": "creators", "query": "civ", "maxItems": 20 }
```

```json
{ "mode": "tags", "query": "anime", "maxItems": 20 }
```

| Field | Type | Description |
|---|---|---|
| `mode` | string | `"models"` (default), `"model-detail"`, `"images"`, `"creators"`, or `"tags"`. |
| `query` | string | Search term. `models` mode searches names, `creators` mode searches usernames, `tags` mode searches tag names. |
| `tag` | string | `models` mode — exact tag filter. |
| `username` | string | `models`/`images` mode — exact creator filter. |
| `types` | array | `models` mode — filter by model type(s) (`Checkpoint`, `LORA`, `TextualInversion`, etc.). |
| `sort` | string | Sort order — value set differs by mode (see input schema for the full list). |
| `period` | string | `models`/`images` mode — `Day`/`Week`/`Month`/`Year`/`AllTime`. |
| `nsfw` | string | `images` mode — content-rating filter. |
| `modelId` | integer | `model-detail` mode: the model to fetch. `images` mode: only images generated with this model (auto-resolved to its versions — see Known limits). |
| `modelIds` | array | `model-detail` mode — multiple model IDs in one run. |
| `modelVersionId` | integer | `images` mode — only images from this exact model version (faster/more direct than `modelId`). |
| `postId` | integer | `images` mode — only images from this post. |
| `maxItems` | integer | Max results to return (`models`/`images`/`creators`/`tags` modes). Pagination is followed automatically up to this cap. Default 100, max 10,000. |
| `maxConcurrency` | integer | `model-detail` mode — how many model IDs to fetch in parallel. Default 4. |
| `proxyConfiguration` | object | Apify Proxy settings. Residential is on by default (not required for this endpoint — it's Civitai's own official public API — kept for production robustness). |

### Output

**Models / model-detail mode** — one record per model, full upstream shape (truncated here for readability):

```json
{
  "_input": "4201",
  "_source": "S1-api",
  "_scrapedAt": "2026-08-25T19:03:40Z",
  "id": 4201,
  "name": "Realistic Vision V6.0 B1",
  "type": "Checkpoint",
  "stats": { "downloadCount": 2304987, "thumbsUpCount": 52805 },
  "creator": { "username": "SG_161222", "image": "https://image.civitai.com/..." },
  "tags": ["photorealistic", "anatomical", "realistic"],
  "modelVersions": [
    {
      "id": 501240,
      "name": "V5.1 Hyper (VAE)",
      "baseModel": "SD 1.5 Hyper",
      "files": [
        {
          "name": "realisticVisionV60B1_v51HyperVAE.safetensors",
          "sizeKB": 2082642.47,
          "hashes": { "SHA256": "F47E942AD4C30D863AD7F53CB60145FFCD2118845DFA705CE8BD6B42E90C4A13" },
          "downloadUrl": "https://civitai.com/api/download/models/501240?fileId=418901",
          "virusScanResult": "Success"
        }
      ]
    }
  ]
}
```

**Images mode** — one record per image:

```json
{
  "_input": "4201",
  "_source": "S1-api",
  "_scrapedAt": "2026-08-25T19:06:38Z",
  "id": 12221839,
  "url": "https://image.civitai.com/.../original=true/....jpeg",
  "width": 1024,
  "height": 1536,
  "nsfwLevel": "None",
  "stats": { "likeCount": 346, "heartCount": 113 },
  "meta": null,
  "username": "SG_161222",
  "baseModel": "SD 1.5 Hyper"
}
```

**Creators / Tags mode:**

```json
{ "_input": "civ", "_source": "S1-api", "_scrapedAt": "...", "username": "civitdiff", "modelCount": 1, "link": "https://civitai.com/api/v1/models?username=civitdiff" }
```

```json
{ "_input": "anime", "_source": "S1-api", "_scrapedAt": "...", "name": "anime", "link": "https://civitai.com/api/v1/models?tag=anime" }
```

A record with `_error` instead of the fields above means that item could not be processed (for example, `"_error": "model_not_found"` for a model ID that doesn't exist).

### Known limits

- **`meta` (prompt, sampler, seed, steps, CFG scale) is always `null`.** This is Civitai's own privacy choice on the public API, not a bug — it holds true even for images whose own internal flags say a prompt exists. There is no public, unauthenticated way to retrieve it.
- **`images` mode filtered by `modelId` is automatically fixed.** Civitai's own API silently returns zero results for `/images?modelId=X` even on the most popular models on the platform — a genuine upstream defect (images are actually indexed by model *version*, not model). This actor detects a `modelId` input and transparently resolves it to that model's version IDs first, so you always get correct results. If you already know the exact model version you want, pass `modelVersionId` directly for a faster, single-request lookup.

# Actor input Schema

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

"models" searches/lists AI models with filters. "model-detail" fetches full detail (all versions, files, download URLs) for specific model ID(s). "images" searches the image gallery. "creators" lists/searches usernames. "tags" lists/searches tags.

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

Free-text search term. Used by "models" mode (searches model names), "creators" mode (searches usernames), and "tags" mode (searches tag names).

## `tag` (type: `string`):

"models" mode only -- only return models with this exact tag.

## `username` (type: `string`):

"models" or "images" mode -- only return items created by this exact username.

## `types` (type: `array`):

"models" mode only -- only return models of these type(s). Leave empty for all types.

## `sort` (type: `string`):

Order to return results in. "models" mode: Highest Rated / Most Downloaded / Most Liked / Most Discussed / Most Collected / Most Images / Newest / Oldest. "images" mode: Most Reactions / Most Comments / Most Collected / Newest / Oldest / Random.

## `period` (type: `string`):

"models" or "images" mode -- only consider items from this time window.

## `nsfw` (type: `string`):

"images" mode only -- filter by content rating. Leave empty for the platform default (safe-for-work only, unauthenticated).

## `modelId` (type: `integer`):

"model-detail" mode: a single model ID. "images" mode: only return images generated with this model.

## `modelIds` (type: `array`):

"model-detail" mode only -- multiple model IDs to fetch full detail for in one run.

## `modelVersionId` (type: `integer`):

"images" mode only -- only return images generated with this specific model version.

## `postId` (type: `integer`):

"images" mode only -- only return images from this specific post.

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

Maximum number of results to return (for "models"/"images"/"creators"/"tags" modes). Pagination is followed automatically until this cap or the end of the result set, whichever comes first.

## `maxConcurrency` (type: `integer`):

"model-detail" mode only -- how many model IDs to fetch in parallel.

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

Apify Proxy configuration. Residential is on by default. Not required for this endpoint (no WAF was found -- it is Civitai's own official public API), but kept on for production robustness.

## Actor input object example

```json
{
  "mode": "models",
  "period": "AllTime",
  "modelId": 4201,
  "maxItems": 100,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All scraped model / image / creator / tag records produced by 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 = {
    "mode": "models",
    "period": "AllTime",
    "modelId": 4201,
    "maxItems": 100,
    "maxConcurrency": 4,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("zucchini_gopher_m2v/civitai-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 = {
    "mode": "models",
    "period": "AllTime",
    "modelId": 4201,
    "maxItems": 100,
    "maxConcurrency": 4,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("zucchini_gopher_m2v/civitai-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 '{
  "mode": "models",
  "period": "AllTime",
  "modelId": 4201,
  "maxItems": 100,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call zucchini_gopher_m2v/civitai-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zucchini_gopher_m2v/civitai-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/NuVWcR8x5iEdWljnL/builds/hudl50oAzgLV8PPNb/openapi.json
