Skip to main content
GET
/
posts
/
latest
cURL
curl --request GET \
  --url https://api.substackapi.dev/posts/latest \
  --header 'X-API-Key: <api-key>'
import requests

url = "https://api.substackapi.dev/posts/latest"

headers = {"X-API-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://api.substackapi.dev/posts/latest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.substackapi.dev/posts/latest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.substackapi.dev/posts/latest"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-API-Key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.substackapi.dev/posts/latest")
.header("X-API-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.substackapi.dev/posts/latest")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
[
  {
    "slug": "my-post",
    "url": "https://example.substack.com/p/my-post",
    "title": "My Post",
    "description": "This is a description of my post",
    "excerpt": "This is an excerpt of my post",
    "body_html": "<p>This is the body of my post</p>",
    "reading_time_minutes": 5,
    "audio_url": "https://example.com/my-post.mp3",
    "date": "2025-03-20T15:30:00Z",
    "likes": 100,
    "paywall": false,
    "cover_image": {
      "original": "https://example.com/my-post.jpg",
      "og": "https://example.com/my-post.jpg",
      "small": "https://example.com/my-post.jpg",
      "medium": "https://example.com/my-post.jpg",
      "large": "https://example.com/my-post.jpg"
    },
    "cover_image_color_palette": {
      "vibrant": "rgb(0, 0, 0)",
      "light_vibrant": "rgb(0, 0, 0)",
      "dark_vibrant": "rgb(0, 0, 0)",
      "muted": "rgb(0, 0, 0)",
      "light_muted": "rgb(0, 0, 0)",
      "dark_muted": "rgb(0, 0, 0)"
    },
    "author": "John Doe",
    "author_image": {
      "original": "https://example.com/my-post.jpg",
      "small": "https://example.com/my-post.jpg",
      "medium": "https://example.com/my-post.jpg",
      "large": "https://example.com/my-post.jpg"
    }
  }
]
{
"code": 400,
"message": "Bad Request"
}

Authorizations

X-API-Key
string
header
required

Test key: sk_test_9b0j6a1bdbf4f38b1 Get production key at auth.substackapi.dev

Query Parameters

publication_url
string
required

The URL of the publication to retrieve posts from (e.g. example.substack.com)

limit
integer<int32>
default:10

The maximum number of results to return (default: 10)

Required range: 1 <= x <= 50
offset
integer<int32>
default:0

The offset of the results to return (default: 0)

Required range: x >= 0

Response

A list of posts

slug
string
Example:

"my-post"

url
string
Example:

"https://example.substack.com/p/my-post"

title
string
Example:

"My Post"

description
string
Example:

"This is a description of my post"

excerpt
string | null
Example:

"This is an excerpt of my post"

body_html
string | null
Example:

"<p>This is the body of my post</p>"

reading_time_minutes
number | null
Example:

5

audio_url
string | null
Example:

"https://example.com/my-post.mp3"

date
string
Example:

"2025-03-20T15:30:00Z"

likes
number
Example:

100

paywall
boolean
Example:

false

cover_image
object
cover_image_color_palette
object
author
string
Example:

"John Doe"

author_image
object