How to connect to the Medium API in Rails

Step 1

Generate an integration token.

Step 2

Let’s look at the docs.

You need to put the access token in your headers like this:

curl -X GET -H “Authorization: Bearer THISTEXTSHOULDBEYOURACCESSTOKEN” -H “Content-Type: application/json” -H “Accepts: application/json” “”

Test it out in the terminal.

If you did it right, you should see a json response like this

Step 3 — Get your posts

You can’t simply request you own posts with their api, probably because that would make too much sense. So how can I get my blog posts on my rails website?

First I read something from an actual good blogger.

Thanks dawg.

Then my nipples tingled, because I knew just what to do. Go in the the rss feed to get my data. <- Replace liyicky with your medium name.

Which looks like this:

Then getting that in a simple ruby class. Forgive the bad code, I’m very rusty.

Test it in the console.

Thank you for reading ❤.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Hey, I’m Jason Cheladyn. Going back to the coding world after 6 years of teaching English in Japan.