Skip to content

Latest commit

 

History

History
92 lines (72 loc) · 1.91 KB

File metadata and controls

92 lines (72 loc) · 1.91 KB

API Reference

This document outlines the internal Substack API endpoints used by this tool. These endpoints are subject to change as they are unofficial.

Base URL

https://substack.com

Authentication

Login

POST /api/v1/login

  • Body: { email, password, redirect: '/' }
  • Returns: 200 OK + Set-Cookie: connect.sid=...

Posts (Drafts & Published)

List Posts

GET /api/v1/posts

  • Query Params:
    • limit: Number of posts (default 20)
    • offset: Pagination offset
    • status: 'draft', 'published', 'all'
  • Returns: Array of Post objects

Create Draft

POST /api/v1/drafts

  • Body:
    • title: String
    • body: HTML content string
    • draft: Boolean (true for draft)
  • Returns: Post object (including ID)

Publish Draft

POST /api/v1/drafts/{id}/publish

  • Path Params: id (Post ID)
  • Returns: Post object (published state)

Delete Post

DELETE /api/v1/posts/{id}

  • Path Params: id (Post ID)

Notes

List Notes

GET /api/v1/notes

  • Query Params: limit
  • Returns: Array of Note objects

Create Note

POST /comment/feed/

  • Body: JSON object representing ProseMirror document structure.
    {
      "bodyJson": {
        "type": "doc",
        "attrs": { "schemaVersion": "v1" },
        "content": [
          { "type": "paragraph", "content": [{ "type": "text", "text": "Hello world" }] }
        ]
      },
      "tabId": "for-you",
      "surface": "feed",
      "replyMinimumRole": "everyone"
    }

Like Note

POST /api/v1/notes/{id}/like

Restack Note

POST /api/v1/notes/{id}/restack

Subscribers

List Subscribers

GET /api/v1/subscribers

  • Query Params: limit
  • Returns: Array of Subscriber objects

Get Stats

GET /api/v1/subscriber_count

  • Returns: { count: number, ... }

Profile

Get Own Profile

GET /api/v1/me

  • Returns: UserProfile object

Get Profile by Slug

GET /user/{slug}/public_profile

  • Returns: UserProfile object