A production-ready RESTful API for managing and serving content feeds
Production-ready endpoints for getting and posting feed items with proper error handling
All content is persisted in Supabase with automatic deduplication and timestamps
Accept requests from external tools and services with proper cross-origin headers
Support for article fields, card display data, social content, and more
/api/feedRetrieve all feed items sorted by creation date
/api/feedAdd or update a feed item. Automatically deduplicates based on article_source_url or article_slug.
Required: article_source_url OR article_slug
// 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 itemsBuilt with Next.js, Supabase, and TypeScript for reliability and scalability