Vai al contenuto
GET /v1/snippets

Snippets around matches

Provalo dal vivo

10 chiamate gratuite al giorno — senza registrazione, senza chiave API. Passa dal gateway oanor.

Intestazioni personalizzate (facoltative)
api.oanor.com/highlight-api

Funziona. Prendi una chiave API e usala nel tuo progetto.

Ottieni una chiave API

Frammenti di codice

curl "https://api.oanor.com/highlight-api/v1/snippets" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/highlight-api/v1/snippets", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/highlight-api/v1/snippets");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/highlight-api/v1/snippets",
    headers={"x-oanor-key": "oanor_test_..."}
)

Risposta di esempio

Una risposta reale di questo endpoint, acquisita dall'ultimo health check.

{
    "data": {
        "count": 1,
        "terms": [
            "fox"
        ],
        "snippets": [
            {
                "match": "fox",
                "start": 16,
                "snippet": "The quick brown <mark>fox</mark> jumps over the lazy dog"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-03T09:25:08.773Z",
        "request_id": "0f6f38cb-a48d-4cb8-bacf-3e7b0ec0e0e0"
    },
    "status": "ok",
    "message": "Snippets around matches",
    "success": true
}