# Glob API
> Match file paths against glob patterns — the same wildcard language used by .gitignore, CI/CD path filters, build tools and the shell. Test whether a single path matches a pattern, or filter a whole list of paths down to the ones that match. Full minimatch support: * (within a segment) and ** (across segments), ? for one character, [abc] character classes, {a,b,c} brace expansion and extended globs, with options for case-insensitivity, matching dotfiles and basename-only matching. Perfect for path-based rules, file selection, route guards, allow/deny lists and config validation. Pure local computation — no key, no third-party service, instant; send large lists via POST. Live, nothing stored. 3 endpoints. Distinct from regular-expression testing and from JSON path queries.

## 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/glob-api/..."
```

## Pricing
- **Free** (Free) — 600 calls/Mo, 2 req/s
- **Starter** ($0/Mo) — 4,500 calls/Mo, 8 req/s
- **Pro** ($17/Mo) — 117,000 calls/Mo, 20 req/s
- **Mega** ($53/Mo) — 605,000 calls/Mo, 50 req/s

## Endpoints

### Glob

#### `GET /v1/filter` — Filter paths by a glob

**Parameters:**
- `paths` (query, required, string) — Comma/newline list or JSON array Example: `a.js,b.ts,c/d.js,e.css`
- `pattern` (query, required, string) — Glob pattern Example: `**/*.js`
- `nocase` (query, optional, string) — Case-insensitive
- `dot` (query, optional, string) — Match dotfiles

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/glob-api/v1/filter?paths=a.js%2Cb.ts%2Cc%2Fd.js%2Ce.css&pattern=%2A%2A%2F%2A.js"
```

**Response:**
```json
{
    "data": {
        "total": 4,
        "matched": [
            "a.js",
            "c/d.js"
        ],
        "options": {
            "dot": false,
            "noext": false,
            "nocase": false,
            "nobrace": false,
            "matchBase": false,
            "noglobstar": false
        },
        "pattern": "**/*.js",
        "matched_count": 2
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:46.721Z",
        "request_id": "90519f7b-7039-4779-9674-a7b3cf33127a"
    },
    "status": "ok",
    "message": "Filter paths by a glob",
    "success": true
}
```

#### `GET /v1/match` — Match a path against a glob

**Parameters:**
- `path` (query, required, string) — File path Example: `src/app/main.js`
- `pattern` (query, required, string) — Glob pattern Example: `**/*.js`
- `nocase` (query, optional, string) — Case-insensitive (true/false)
- `dot` (query, optional, string) — Match dotfiles (true/false)
- `matchBase` (query, optional, string) — Match basename (true/false)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/glob-api/v1/match?path=src%2Fapp%2Fmain.js&pattern=%2A%2A%2F%2A.js"
```

**Response:**
```json
{
    "data": {
        "path": "src/app/main.js",
        "match": true,
        "options": {
            "dot": false,
            "noext": false,
            "nocase": false,
            "nobrace": false,
            "matchBase": false,
            "noglobstar": false
        },
        "pattern": "**/*.js"
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:46.826Z",
        "request_id": "b87fd9b1-e081-4fb1-b7d3-23e9fae26b37"
    },
    "status": "ok",
    "message": "Match a path against a glob",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

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

**Response:**
```json
{
    "data": {
        "name": "Glob API",
        "notes": "** crosses path separators; * does not. Use matchBase=true to match a bare *.js against any depth. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/match",
                "params": {
                    "dot": "bool (match leading dot)",
                    "path": "the path (required)",
                    "nocase": "bool",
                    "pattern": "glob pattern (required)",
                    "matchBase": "bool (match basename)"
                },
                "returns": "whether the path matches"
            },
            {
                "path": "/v1/filter",
                "params": {
                    "paths": "comma/newline list or JSON array (required)",
                    "pattern": "glob (required)",
                    "nocase/dot/matchBase": "options"
                },
                "returns": "the subset of paths that match"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Match file paths against glob patterns the way .gitignore, CI path filters and shells do — *, **, ?, [..] character classes, {a,b} brace expansion and extglobs — powered by minimatch. Test one path or filter a list. Pure local, no key."
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:46.927Z",
       
…(truncated, see openapi.json for full schema)
```


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