AutoSite AI API

A production-ready RESTful API for managing and serving content feeds

1

RESTful API

Production-ready endpoints for getting and posting feed items with proper error handling

2

Database Backed

All content is persisted in Supabase with automatic deduplication and timestamps

3

CORS Enabled

Accept requests from external tools and services with proper cross-origin headers

4

Rich Metadata

Support for article fields, card display data, social content, and more

API Endpoints

GET/api/feed

Retrieve all feed items sorted by creation date

POST/api/feed

Add or update a feed item. Automatically deduplicates based on article_source_url or article_slug.

Required: article_source_url OR article_slug

Example Usage

// POST a new feed item
const response = await fetch('/api/feed', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    article_title: 'My Article',
    article_slug: 'my-article',
    article_source_url: 'https://example.com/article',
    card_title: 'Card Title',
    card_tag: 'technology',
    social_cta: 'Check this out!'
  })
})

// GET all feed items
const result = await fetch('/api/feed')
const data = await result.json()
console.log(data.data) // Array of feed items

Built with Next.js, Supabase, and TypeScript for reliability and scalability