Back to Documentation
API Reference

Get Single Post

Retrieve a single blog post by its slug with full content and metadata.

GET
client.getPost(slug)
import { LightweightClient } from 'lightweight-client';

async function getPost(slug: string) {
  const key = process.env.LIGHTWEIGHT_API_KEY;
  if (!key) throw Error('LIGHTWEIGHT_API_KEY environment variable must be set');

  const client = new LightweightClient(key);
  return client.getPost(slug);
}

Parameters

slug
string
required

The URL-friendly slug identifier of the post to retrieve.

Response

{
  "id": "8baeb8b2-2c0a-4729-8124-6c031fe61f56",
  "slug": "how-to-see-your-youtube-subscribers",
  "headline": "How to See Your Subscribers on YouTube (Working Method) - 2025",
  "metaDescription": "Learn how to see your subscribers on YouTube. I found the hidden menu that reveals who's following you (97% of creators miss this).",
  "publishedAt": "2025-09-08T10:45:42.514Z",
  "createdAt": "2025-09-08T10:45:42.648Z",
  "readingTime": 2,
  "image": "https://seoai-blog.s3.amazonaws.com/...",
  "html": "<h2 id=\"how-to-see-your-subscribers-on-youtube-and-why-90-are-invisible\">how to see your subscribers on youtube (and why 90% are invisible)</h2><p></p><p>you just hit 1,000 subscribers. 🎉</p><p>you're pumped. you wanna see who these legends are...</p>",
  "category": {
    "title": "Youtube how-to",
    "slug": "Youtube"
  },
  "tags": ["how-to", "youtube tips"],
  "relatedPosts": [],
  "heroSection": "<!-- Pre-rendered HTML for the hero section -->",
  "author": {
    "name": "Jack Friks",
    "title": "Founder",
    "image": "https://seoai-blog.s3.amazonaws.com/..."
  },
  "navigationMenu": [
    {
      "id": "how-to-see-your-subscribers-on-youtube-and-why-90-are-invisible",
      "text": "how to see your subscribers on youtube (and why 90% are invisible)",
      "level": 2
    },
    {
      "id": "how-to-find-your-youtube-subscriber-list-in-47-seconds",
      "text": "how to find your youtube subscriber list in 47 seconds",
      "level": 2
    },
    {
      "id": "heading-2",
      "text": "on desktop (the only real way)",
      "level": 2
    },
    {
      "id": "heading-3",
      "text": "Why you can't see 90% of your youtube subscribers",
      "level": 1
    },
    {
      "id": "heading-4",
      "text": "what youtube shows about public subscribers (spoiler: not much)",
      "level": 1
    }
  ]
}

Response Schema

idstring

Unique identifier for the post

slugstring

URL-friendly version of the headline

headlinestring

The main title of the blog post

htmlstring

The complete HTML content of the post, ready for rendering

publishedAtstring (ISO 8601)

Timestamp when the post was published

readingTimenumber

Estimated reading time in minutes

imagestring

URL of the featured image

categoryobject

Category information with title and slug

authorobject

Author details including name, title, and image

navigationMenuarray

Table of contents with section IDs, text, and heading levels for navigation

Notes
  • The html field contains the complete rendered HTML content, including headings with IDs for navigation
  • The heroSection field contains pre-rendered HTML for the post header/hero area
  • Navigation menu items correspond to headings in the HTML content and include the heading level (1-6)
  • If a post is not found, the API returns a 404 error with an appropriate error message
  • Images in the HTML content are already optimized and served from CDN