Skip to content

Quick Start

Base URL

https://unihra.ru/api/v1

Minimal Example — cURL

bash
# 1. Create a task
TASK=$(curl -s -X POST https://unihra.ru/api/v1/process \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "own_page": "https://example.com/product",
    "competitor_urls": ["https://comp1.com", "https://comp2.com"],
    "queries": ["buy product online", "best product 2026"],
    "lang": "en"
  }')

TASK_ID=$(echo $TASK | jq -r .task_id)

# 2. Stream the result via SSE
curl -N -H "Authorization: Bearer YOUR_KEY" \
  "https://unihra.ru/api/v1/process/status/$TASK_ID"

Minimal Example — Python

python
import requests, json

KEY = "YOUR_KEY"
HEADERS = {"Authorization": f"Bearer {KEY}", "Content-Type": "application/json"}
BASE = "https://unihra.ru/api/v1"

# 1. Create task
r = requests.post(f"{BASE}/process", headers=HEADERS, json={
    "own_page": "https://example.com/product",
    "competitor_urls": ["https://comp1.com", "https://comp2.com"],
    "queries": ["buy product online"],
    "lang": "en",
})
task_id = r.json()["task_id"]

# 2. Stream until SUCCESS
with requests.get(f"{BASE}/process/status/{task_id}", headers=HEADERS, stream=True) as resp:
    for line in resp.iter_lines():
        if line.startswith(b"data: "):
            event = json.loads(line[6:])
            if event["state"] == "SUCCESS":
                result = event["result"]
                break

# 3. Top umbrella gaps
for gap in result["Umbrella Analysis"][:5]:
    print(gap["lemma"], "→", gap["recommendation"])

Python SDK

Use the official Python SDK — it handles SSE streaming, retries, and Excel export automatically.

bash
pip install "unihra[full]"

Pricing

ModeCredits
Standard analysis1 credit
Extended (Knowledge Graph, triplet_analysis: true)5 credits

Next Steps