# pub.dev API
> The pub.dev registry — home of the Dart and Flutter package ecosystem — as an API. Look up any package for its description, latest version, repository, documentation and homepage links, Dart SDK constraint, whether it is a Flutter package, its dependencies and recent version history; search the registry by keyword (sorted by relevance, popularity, likes, points, downloads or recency); and read a package's popularity score — its like count, pub points out of the maximum, popularity percentage and 30-day download count. Live from the official pub.dev API. Ideal for package dashboards, dependency and supply-chain tooling, Flutter developer portals and ecosystem analytics. Open data from pub.dev.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/pubdev-api/..."
```

## Pricing
- **Free** (Free) — 3,470 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 47,700 calls/Mo, 8 req/s
- **Pro** ($12/Mo) — 236,200 calls/Mo, 20 req/s
- **Mega** ($33/Mo) — 1,190,000 calls/Mo, 50 req/s

## Endpoints

### pub.dev

#### `GET /v1/package` — Package metadata + recent versions

**Parameters:**
- `name` (query, required, string) — Package name, e.g. http, provider Example: `http`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pubdev-api/v1/package?name=http"
```

**Response:**
```json
{
    "data": {
        "package": {
            "name": "http",
            "flutter": false,
            "homepage": null,
            "published": "2025-11-10T18:27:56.434747Z",
            "repository": "https://github.com/dart-lang/http/tree/master/pkgs/http",
            "description": "A composable, multi-platform, Future-based API for HTTP requests.",
            "pub_dev_url": "https://pub.dev/packages/http",
            "dependencies": [
                "async",
                "http_parser",
                "meta",
                "web"
            ],
            "documentation": null,
            "version_count": 130,
            "latest_version": "1.6.0",
            "sdk_constraint": "^3.4.0",
            "recent_versions": [
                {
                    "version": "1.6.0",
                    "published": "2025-11-10T18:27:56.434747Z"
                },
                {
                    "version": "1.5.0",
                    "published": "2025-08-07T22:35:23.863279Z"
                },
                {
                    "version": "1.5.0-beta.2",
                    "published": "2025-07-15T23:37:56.942822Z"
                },
                {
                    "version": "1.5.0-beta",
                    "published": "2025-07-08T17:55:50.858454Z"
                },
                {
                    "version": "1.4.0",
                    "published": "2025-05-06T00:17:13.636460Z"
                },
                {
                    
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/score` — Popularity metrics for a package

**Parameters:**
- `name` (query, required, string) — Package name, e.g. http Example: `http`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pubdev-api/v1/score?name=http"
```

**Response:**
```json
{
    "data": {
        "score": {
            "tags": [
                "publisher:dart.dev",
                "has:topic",
                "sdk:dart",
                "sdk:flutter",
                "platform:android",
                "platform:ios",
                "platform:windows",
                "platform:linux",
                "platform:macos",
                "platform:web",
                "runtime:native-aot",
                "runtime:native-jit",
                "runtime:web",
                "is:null-safe",
                "is:wasm-ready",
                "is:dart3-compatible",
                "license:bsd-3-clause",
                "license:fsf-libre",
                "license:osi-approved",
                "topic:http",
                "topic:network",
                "topic:protocols"
            ],
            "likes": 8444,
            "max_points": 160,
            "pub_points": 160,
            "last_updated": null,
            "downloads_30d": 8808968,
            "popularity_percent": null
        },
        "package": "http"
    },
    "meta": {
        "timestamp": "2026-05-31T11:53:06.207Z",
        "request_id": "5308ec42-5903-4ad7-b4bd-7b62bdaa6426"
    },
    "status": "ok",
    "message": "Score retrieved",
    "success": true
}
```

#### `GET /v1/search` — Search the registry

**Parameters:**
- `q` (query, required, string) — Search term Example: `http`
- `sort` (query, optional, string) — top | text | created | updated | popularity | like | points | downloads
- `limit` (query, optional, string) — Results (1-100, default 20) Example: `20`
- `page` (query, optional, string) — Page number Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pubdev-api/v1/search?q=http&limit=20&page=1"
```

**Response:**
```json
{
    "data": {
        "page": 1,
        "sort": "top",
        "count": 10,
        "query": "http",
        "results": [
            {
                "name": "http",
                "pub_dev_url": "https://pub.dev/packages/http"
            },
            {
                "name": "dio",
                "pub_dev_url": "https://pub.dev/packages/dio"
            },
            {
                "name": "google_fonts",
                "pub_dev_url": "https://pub.dev/packages/google_fonts"
            },
            {
                "name": "retry",
                "pub_dev_url": "https://pub.dev/packages/retry"
            },
            {
                "name": "http_parser",
                "pub_dev_url": "https://pub.dev/packages/http_parser"
            },
            {
                "name": "chopper",
                "pub_dev_url": "https://pub.dev/packages/chopper"
            },
            {
                "name": "oauth2",
                "pub_dev_url": "https://pub.dev/packages/oauth2"
            },
            {
                "name": "dio_cache_interceptor",
                "pub_dev_url": "https://pub.dev/packages/dio_cache_interceptor"
            },
            {
                "name": "retrofit_generator",
                "pub_dev_url": "https://pub.dev/packages/retrofit_generator"
            },
            {
                "name": "firebase_performance",
                "pub_dev_url": "https://pub.dev/packages/firebase_performance"
            }
  
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Source & sort options

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pubdev-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Live pub.dev registry data. /v1/package = metadata (description, repo, SDK constraint, dependencies, recent versions); /v1/search = search the registry; /v1/score = popularity metrics (likes, pub points out of max, popularity %, 30-day downloads).",
        "source": "pub.dev (the Dart / Flutter package registry)",
        "endpoints": [
            "/v1/package",
            "/v1/search",
            "/v1/score",
            "/v1/meta"
        ],
        "sort_options": [
            "top",
            "text",
            "created",
            "updated",
            "popularity",
            "like",
            "points",
            "downloads"
        ]
    },
    "meta": {
        "timestamp": "2026-05-31T11:53:06.549Z",
        "request_id": "206d67f3-1e83-4d2e-b2a2-547e78aa1923"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/pubdev-api
OpenAPI spec: https://www.oanor.com/api/pubdev-api/openapi.json
