Title: Access Substack Data via API
Version: 0.1.15
Description: An interface to access data from Substack publications via API. Users can fetch the latest, top, search for specific posts, or retrieve a single post by its slug. This functionality is useful for developers and researchers looking to analyze Substack content or integrate it into their applications. For more information, visit the API documentation at https://substackapi.dev/introduction.
License: MIT + file LICENSE
URL: https://github.com/posocap/substackR
BugReports: https://github.com/posocap/substackR/issues
Encoding: UTF-8
RoxygenNote: 7.3.2
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0)
Config/testthat/edition: 3
VignetteBuilder: knitr
Imports: cli, httr2, rlang
Depends: R (≥ 4.1.0)
NeedsCompilation: no
Packaged: 2025-06-15 00:49:50 UTC; user
Author: Jason Rand [aut, cre]
Maintainer: Jason Rand <info@posocap.com>
Repository: CRAN
Date/Publication: 2025-06-17 06:50:02 UTC

Latest Posts

Description

Fetch the latest posts from a Substack publication.

Usage

get_substack_latest(publication_url, limit = 10L, offset = 0L)

Arguments

publication_url

Character, e.g. "example.substack.com".

limit

Integer ⁠[1–50]⁠, default 10.

offset

Integer ⁠>= 0⁠, default 0.

Value

A data.frame (possibly zero‐row) of post records.


Get Single Post

Description

Fetch a single post by its slug. Returns a one‐row data.frame, or zero‐row if not found.

Usage

get_substack_post(publication_url, slug)

Arguments

publication_url

Character.

slug

Character. Post slug.

Value

A data.frame with one row (or zero rows if missing).


Description

Search posts in a Substack publication. If zero results, returns an empty data.frame.

Usage

get_substack_search(publication_url, query, limit = 10L, offset = 0L)

Arguments

publication_url

Character, e.g. "example.substack.com".

query

Character. Search term.

limit

Integer ⁠[1–50]⁠, default 10.

offset

Integer ⁠>= 0⁠, default 0.

Value

A data.frame (possibly zero‐row).


Top Posts

Description

Fetch the most popular posts from a Substack publication.

Usage

get_substack_top(publication_url, limit = 10L, offset = 0L)

Arguments

publication_url

Character, e.g. "example.substack.com".

limit

Integer ⁠[1–50]⁠, default 10.

offset

Integer ⁠>= 0⁠, default 0.

Value

A data.frame (possibly zero‐row) of post records.


Set your Substack API Key

Description

Store your key once per session. Subsequent calls to other functions will use this key automatically.

Usage

set_substack_key(key)

Arguments

key

A single string: your Substack API key.

Value

Invisibly TRUE if successful.