API Endpoints

Content Endpoints

API endpoints for summaries, schema markup, and page content.

Page Summaries

Get AI-generated summaries for all pages on a site.

text
GET /sites/{id}/summaries

Request

Bash
curl -X GET "https://aioradar.vercel.app/api/sites/{id}/summaries" \
  -H "Authorization: Bearer aio_sk_your_api_key"

Response

JSON
{
  "data": {
    "summaries": [
      {
        "page_id": "123",
        "title": "Costa Rica Adventure Tours",
        "url": "https://example.com/costa-rica-tours",
        "summary": "Discover thrilling adventure tours in Costa Rica including zip-lining through rainforests, whitewater rafting, and volcano hikes. Expert guides, small groups, and sustainable tourism practices.",
        "generated_at": "2024-01-15T10:30:00Z",
        "model": "gpt-4o"
      }
    ],
    "total": 25,
    "with_summaries": 20,
    "pending": 5
  }
}

Summary Object

FieldTypeDescription
page_idstringWordPress post ID
titlestringPage title
urlstringFull page URL
summarystringAI-generated summary (150-200 words)
generated_atstringISO 8601 generation timestamp
modelstringLLM model used for generation

Schema Templates

Get JSON-LD schema markup templates for a site.

text
GET /sites/{id}/schema

Request

Bash
curl -X GET "https://aioradar.vercel.app/api/sites/{id}/schema" \
  -H "Authorization: Bearer aio_sk_your_api_key"

Query Parameters

ParameterTypeDefaultDescription
formatstringjsonOutput format: json or script

Response (JSON format)

JSON
{
  "data": {
    "schemas": {
      "organization": {
        "@context": "https://schema.org",
        "@type": "TravelAgency",
        "name": "Example Travel Tours",
        "url": "https://example.com",
        "description": "Costa Rica adventure tour specialists"
      },
      "website": {
        "@context": "https://schema.org",
        "@type": "WebSite",
        "name": "Example Travel Tours",
        "url": "https://example.com"
      },
      "breadcrumbs": {
        "@context": "https://schema.org",
        "@type": "BreadcrumbList",
        "itemListElement": []
      }
    },
    "detected_business_type": "TravelAgency"
  }
}

Response (Script format)

JSON
{
  "data": {
    "scripts": [
      "<script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"TravelAgency\",...}</script>",
      "<script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",...}</script>"
    ]
  }
}

Schema Types Generated

  • Organization/LocalBusiness - Business information
  • WebSite - Site metadata
  • TourTrip - Tour/product pages (detected automatically)
  • BreadcrumbList - Navigation breadcrumbs

Page by Slug

Get page content by URL slug.

text
GET /sites/{id}/pages/by-slug

Request

Bash
curl -X GET "https://aioradar.vercel.app/api/sites/{id}/pages/by-slug?slug=costa-rica-tours" \
  -H "Authorization: Bearer aio_sk_your_api_key"

Query Parameters

ParameterTypeRequiredDescription
slugstringYesURL slug or partial URL to match

Response

JSON
{
  "data": {
    "page_id": "123",
    "title": "Costa Rica Adventure Tours",
    "url": "https://example.com/costa-rica-tours",
    "content": "---\ntitle: Costa Rica Adventure Tours\nurl: https://example.com/costa-rica-tours\ntype: page\nword_count: 1500\nmodified: 2024-01-15\nsource: full_content\n---\n\nDiscover the best adventure tours...",
    "format": "markdown",
    "source": "full_content"
  }
}

Content Source Priority

  1. full_content - Complete page content from sync
  2. content_excerpt - Excerpt if full content not available
  3. summary - AI summary as fallback (with explicit note)

Page by ID (Markdown)

Get page content as Markdown by WordPress post ID.

text
GET /sites/{id}/pages/{pageId}/markdown

Request

Bash
curl -X GET "https://aioradar.vercel.app/api/sites/{id}/pages/123/markdown" \
  -H "Authorization: Bearer aio_sk_your_api_key"

Response

text
---
title: Costa Rica Adventure Tours
url: https://example.com/costa-rica-tours
type: page
word_count: 1500
last_modified: 2024-01-15T10:30:00Z
source: full_content
---

# Costa Rica Adventure Tours

Discover the best adventure tours in Costa Rica...

## Highlights

- Zip-lining through rainforests
- Whitewater rafting
- Volcano hikes

## Book Your Adventure

Contact us to start planning your trip.

The response is returned as text/markdown content type with YAML frontmatter.