# Marginalia Search API reference

> The Marginalia Search API runs queries against the Marginalia search engine and returns the results as JSON: the query, the license text, and a list of results with url, title and description. It indexes small, independent sites, which makes it useful for finding personal pages and older web…

Source: https://osinttools.io/apis/marginalia-search/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

Compiled by OSINTtools.io editors from the vendor's docs, updated Nov 29, 2026. Listing: https://osinttools.io/tools/marginalia-search/

- Base URL: https://api2.marginalia-search.com
- Authentication: API key in the `API-Key` header. Get a key: https://about.marginalia-search.com/article/api/ The shared key public is for experimentation only.
- Free tier: yes
- Rate limits: Not stated in the docs
- Vendor docs: https://about.marginalia-search.com/article/api/

## Overview

The Marginalia Search API runs queries against the Marginalia search engine and returns the results as JSON: the query, the license text, and a list of results with url, title and description. It indexes small, independent sites, which makes it useful for finding personal pages and older web content that large engines rank low.

Send the key in the `API-Key` header. The shared key `public` works for experimentation but cannot create custom filters and often hits a rate limit. Free non-commercial keys are requested by email, paid non-commercial keys are a one-time payment, and commercial keys are metered. Free and paid non-commercial keys are provided under CC-BY-NC-SA 4.0.

Custom filters are XML documents (domain include and exclude, term rules, temporal bias, limits) created through the filter endpoints and then used through the `filter` search parameter. The older API at `api.marginalia.nu`, which puts the key in the path, is deprecated and gets no new features; it is not described here.

## Errors

| Status | Meaning |
| --- | --- |
| 503 | The shared public key hit its rate limit (stated for the deprecated API) |

## Search

### Search the Marginalia index.

`GET /search`

- Takes: Name
- Footprint: passive (the target is not contacted)

Returns matching pages. The docs do not give default values for the optional parameters.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `query` | query | string | yes | Search terms Example: json api |
| `count` | query | integer | no | Number of results, 1 to 100 Example: 10 |
| `timeout` | query | integer | no | Query execution timeout in milliseconds, 50 to 250 Example: 150 |
| `dc` | query | integer | no | Maximum results per domain, 1 to 100 Example: 2 |
| `page` | query | integer | no | Results page, starting at 1 Example: 1 |
| `nsfw` | query | integer | no | 0 for no filter; 1 (experimental) reduces extreme results Example: 0 One of: 0, 1 |
| `filter` | query | string | no | Name of a custom filter Example: my-filter |

Response fields:

- `query` (string): The query that was run
- `license` (string): License information for the results
- `results[].url` (string): Address of the result
- `results[].title` (string): Page title
- `results[].description` (string): Page description

```bash
curl 'https://api2.marginalia-search.com/search?query=json%20api' \
  -H 'API-Key: YOUR_API_KEY'
```

Example response (200):

```json
{
  "query": "json api",
  "license": "Example license text",
  "results": [
    {
      "url": "https://example.com/json-api-notes",
      "title": "Notes on a JSON API",
      "description": "A short example description of the page."
    }
  ]
}
```

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
