FastAPI Integration

Backlink data in FastAPI. Async. Type-safe.

Call RankParse from async FastAPI endpoints using httpx. Add domain authority, tech stack detection, and backlink data to any Python backend in 10 minutes.

Patterns

Async proxy endpoint

Proxy RankParse behind your own FastAPI endpoint. Add your own auth, caching, and rate limiting without changing client code.

Concurrent enrichment

Use asyncio.gather() to call multiple RankParse endpoints in parallel — authority + tech stack in one response time.

Background enrichment task

Use FastAPI BackgroundTasks or Celery to enrich a domain list asynchronously after a form submission.

Pydantic response models

Wrap RankParse JSON in Pydantic models for type-safe responses and auto-generated OpenAPI docs.

Example: async FastAPI integration

Async domain info endpoint that calls authority and tech stack in parallel.

# main.py — FastAPI app with RankParse integration
import asyncio
from fastapi import FastAPI, Query, HTTPException
from rankparse import AsyncRankParseClient

app = FastAPI()
client = AsyncRankParseClient(api_key="rp_your_key")


@app.get("/domain-info")
async def domain_info(domain: str = Query(..., description="Domain to analyze")):
    """Return authority score and tech stack for a domain."""
    try:
        authority, tech = await asyncio.gather(
            client.domain_authority(domain),
            client.tech_stack(domain),
        )
    except Exception as e:
        raise HTTPException(status_code=502, detail=str(e))

    return {
        "domain": domain,
        "authority_score": authority["data"]["authority_score"],
        "referring_domains": authority["data"]["referring_domains"],
        "tech_stack": [t["name"] for t in tech["data"].get("technologies", [])],
    }


@app.get("/backlinks")
async def backlinks(
    domain: str = Query(...),
    limit: int = Query(20, ge=1, le=1000),
):
    """Proxy the RankParse backlinks endpoint."""
    result = await client.backlinks(domain, limit=limit)
    return result["data"]

Add SEO data to your FastAPI app.

100 free credits. No credit card. 10-minute integration.

Get API key — free