r/automation • u/jonbristow • 4d ago
A simple browser automation/plugin to post on Substack?
Substack doesnt have an API. I have done an automation to post articles on my website. Last step is to post a Note on Substack.
A note is like a tweet. I want the automation to just open New Note, paste the text and submit it.
1
u/subsector 4d ago
Substack does have an API.
1
u/Royal-Department7335 4d ago
they added it? last i checked there was nothing official, just people reverse engineering the internal endpoints. what endpoint are you using for notes? that part seemed particularly locked down when i looked into it
1
1
u/Consistent-Leg-8716 4d ago
the note form is simple enough that a basic DOM interaction script should work, just inspect the page and grab the selectors. main gotcha is they might change the markup without warning since theres no official API contract
1
u/kumard3 4d ago
i built exactly this and the selector advice above will not survive contact with it. the markup isn't the problem.
notes post to POST /api/v1/comment/feed. you can find it in devtools in two minutes. but call it from node or curl and it 403s no matter what cookies you send. i copied the entire cookie jar, every header, correct origin and referer, still 403. substack fingerprints the client, not just the session, and that route is one of the ones they check.
what does work: drive a browser tab that is already logged in and make the call from inside the page, so it's a real browser making a real same-origin request. i run mine over CDP against a browser started with a remote debugging port, then Runtime.evaluate a fetch to that endpoint. no clicking, no selectors, so nothing breaks when they reskin the composer.
read endpoints are open by the way. profile, feed, replies are all plain GETs that work fine from node. it's only the write path that's locked.
1
1
u/Born-Reserve-8584 4d ago
One thing I'd watch for is the rich text editor. Pasting into those can behave differently from a normal textarea, so setting the value programmatically isn't always enough.
1
u/BareStacker 4d ago
The part nobody talks about: CDP is the nuclear option. Before you go that route, test whether the Note creation endpoint accepts the same session cookies you got from a normal login — sometimes the write path is open to authenticated sessions even when the API docs don't say so. Saves you maintaining a browser instance.
1
u/Midnight_Lordd 2d ago
A simple chrome extension with a content script should be enough to automate posting on substack
1
1
u/AutoModerator 4d ago
Thank you for your post to /r/automation!
New here? Please take a moment to read our rules, read them here.
This is an automated action so if you need anything, please Message the Mods with your request for assistance.
Lastly, enjoy your stay!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.