Skip to main content

Endpoint

GET /api/get_post_by_id/<post_id>
Retrieve detailed information about a single post by its ID.

Path parameters

post_id
integer
required
Unique identifier of the post to retrieve

Response

id
integer
Unique post identifier
username
string
Username of the post author
content
string
Post content text (max 512 characters)
created_at
string
ISO timestamp of when the post was created
upvotes
integer
Number of upvotes the post has received
downvotes
integer
Number of downvotes the post has received
error
string
Error message if the post was not found

Status codes

  • 200: Post retrieved successfully
  • 404: Post not found

Example request

curl https://api.example.com/api/get_post_by_id/123

Example responses

{
  "id": 123,
  "username": "alice",
  "content": "Just joined Mirage! Excited to connect with everyone.",
  "created_at": "2024-03-15T10:30:00",
  "upvotes": 15,
  "downvotes": 2
}

Notes

  • No authentication required - posts are publicly viewable
  • Useful for deep-linking to specific posts
  • Use alongside /api/get_replies/<post_id> to fetch post replies

Build docs developers (and LLMs) love