> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/datasets/universe/universe/universe-search.md).

# Universe Search

Search Roboflow Universe projects, datasets, and models programmatically with the Python SDK.

## Python SDK

[Roboflow Universe](https://universe.roboflow.com) is the public catalog of community-shared projects, datasets, and models. The Python SDK exposes a low-level adapter you can use to search Universe programmatically.

### Search

```python
from roboflow.adapters import rfapi

results = rfapi.search_universe(
    "vehicles",
    api_key="YOUR_API_KEY",
    project_type="object-detection",  # optional
    limit=12,
    page=1,
)

for project in results.get("results", []):
    print(project["workspace"], project["project"], project["name"])
```

#### Parameters

* `query` (str, positional) - search term.
* `api_key` (str, kw-only) - your Roboflow API key. Required for Universe rate limits.
* `project_type` (str, kw-only, optional) - filter by project type. One of `object-detection`, `classification`, `instance-segmentation`, `semantic-segmentation`, `keypoint-detection`.
* `limit` (int, kw-only, default `12`) - page size.
* `page` (int, kw-only, default `1`) - 1-indexed page number.

#### Response

The function returns the JSON response body verbatim. Each result entry includes the workspace slug, project slug, project name, type, image count, and (for trained models) version metadata you can plug straight into `Roboflow().workspace(...).project(...).version(...).model.predict()`.

Each result also includes `thumbnail` and `annotationThumbnail` fields (both nullable strings). `thumbnail` is a URL to the project's thumbnail image, and `annotationThumbnail` is a URL to a sample annotated image from the project. Either field is `null` when the corresponding data is unavailable.

### Run a Universe model directly

Once you've found a model with `search_universe`, run inference on it the same way you would your own model:

```python
import roboflow

rf = roboflow.Roboflow(api_key="YOUR_API_KEY")
project = rf.workspace("roboflow-100").project("poker-cards-cxcvz")
model = project.version(1).model

predictions = model.predict("hand.jpg", confidence=50, overlap=30).json()
```

See [Run a Model on an Image](https://docs.roboflow.com/deployment/roboflow-cloud/serverless-api#python-sdk) for details on `predict()` across task types.

## CLI

You can search for public datasets and models on [Roboflow Universe](https://universe.roboflow.com) from the command line.

### Search Universe

```bash
roboflow universe search "hard hats"
```

```bash
roboflow universe search "hard hats" --json
```

#### Options

| Flag      | Description                             |
| --------- | --------------------------------------- |
| `--type`  | Filter by `dataset` or `model`          |
| `--limit` | Maximum number of results (default: 12) |

#### Examples

Search for datasets only:

```bash
roboflow universe search "safety vest" --type dataset
```

Limit results:

```bash
roboflow universe search "license plates" --type model --limit 5
```

### JSON Output

Use `--json` for structured output that's safe to pipe:

```bash
roboflow universe search "hard hats" --json | jq '.[].name'
roboflow universe search "cars" --type dataset --limit 3 --json
```

Exit codes: 0 = success, 1 = error, 2 = auth error.

## MCP Server

Connect your AI agent to the [MCP Server](https://docs.roboflow.com/agents/mcp-server) and it can find a public dataset with these tools:

<table data-search="false"><thead><tr><th width="290">Tool</th><th>Description</th></tr></thead><tbody><tr><td><code>universe_search</code></td><td>Search Roboflow Universe for datasets or models.</td></tr><tr><td><code>universe_dataset_images_search</code></td><td>Search images inside a public Universe dataset given its URL.</td></tr></tbody></table>
