Skip to main content

Overview

Content posts are the core data type in Sports Index. Posts can be external media (tweets, YouTube videos), uploaded media, charts, data tables, timelines, pages, or collections. Most read endpoints are public with optional authentication for personalized data.

Post Types

TypeDescription
external_mediaEmbedded content from Twitter, YouTube, Instagram, TikTok, etc.
uploaded_mediaUser-uploaded images and videos
chartData visualizations (bar charts, scatter plots, etc.)
data_tableStructured tabular data
timelineOrdered sequences of posts with dates
pageRich page layouts (deprecated in favor of collections)
collectionBlock-based page layouts with the collection editor

Endpoints

Get Post by Slug

GET /api/posts/by-slug/{slug}
Returns the full post with content. Increments the view counter. Response:
{
  "id": "uuid",
  "slug": "my-collection-abc123",
  "post_type": "collection",
  "title": "My Collection",
  "description": "A sports analysis piece",
  "created_by": "uuid",
  "creator_username": "johndoe",
  "visibility": "public",
  "event_datetime": "2026-01-15T00:00:00Z",
  "content": { },
  "tags": ["pickleball", "ppa-tour"],
  "view_count": 142,
  "share_count": 8
}

Get Post by ID

GET /api/posts/by-id/{post_id}
Same as by-slug but uses the post UUID.

Get Post Header

GET /api/posts/header/{slug}
Lightweight endpoint returning post metadata without full content. Useful for link previews and cards.

Content Feed

GET /api/posts/feed
Returns a paginated content feed with filtering. Query Parameters:
ParameterTypeDescription
typesstringComma-separated post types to include
topicstringFilter by topic name
topic_idstringFilter by topic ID
tagsstringFilter by tags
user_idstringFilter by creator
datedbooleanOnly posts with dates
include_uploadsbooleanInclude uploaded media
sortstringSort field
orderstringasc or desc
limitintegerResults per page (default: 20)
offsetintegerPagination offset
Response:
{
  "posts": [ ],
  "total_count": 156,
  "has_more": true
}

Search Posts

GET /api/posts/search
Query Parameters:
ParameterTypeDescription
qstringSearch query (required)
typesstringFilter by post types
authorstringFilter by author username
platformstringFilter by platform (twitter, youtube, etc.)
topicsstringFilter by topics
limitintegerMax results

GET /api/posts/unified-search
Searches across posts, topics, and user profiles simultaneously. Query Parameters:
ParameterTypeDescription
qstringSearch query (required)
limitintegerMax results per category
semanticbooleanEnable semantic/embedding search
Response:
{
  "indexes": [ ],
  "topics": [ ],
  "profiles": [ ],
  "match_type": "semantic"
}

Resolve URL

GET /api/posts/resolve?url={url}
Resolves an external URL to get embed metadata (platform, title, thumbnail, author). Useful for previewing links before saving.

Get Post Templates

GET /api/posts/templates
Returns available public collection templates. Response:
[
  {
    "id": "uuid",
    "title": "Player Profile",
    "description": "Standard athlete profile layout",
    "tags": ["athlete"]
  }
]

Posts by User

GET /api/posts/by-user/{username}
Get all public posts created by a specific user. Query Parameters:
ParameterTypeDescription
typesstringFilter by post types
limitintegerResults per page
offsetintegerPagination offset

Bookmarks

GET /api/posts/bookmarks
Requires authentication.
Returns the current user’s bookmarked posts.
ParameterTypeDescription
limitintegerResults per page
offsetintegerPagination offset