medup v0.1.9

Download all content from Medium to local folder
  • v0.1.9 - September 17, 2020
  • v0.1.8 - May 22, 2020
  • v0.1.7 - March 15, 2020
  • v0.1.6 - March 12, 2020
  • v0.1.5 - January 21, 2020



Sync all content from Medium with local folder via API

Table of Contents


Export post

Export a single medium post to local


Author's posts

Export all articles written by single author to special folder posts/miry

medium -u miry -d posts/miry

User's recommendations

Export all articles recommended by miry:

medium -u miry -d posts/recommendations -r


  • Discover all articles from user account available in public
  • Allow to download all recommended articles by user
  • Download images used inside article
  • Save posts in markdown format
  • Convert a single article in markdown format

Getting Started


Install medup tool to the MacOS or Linux via Hombrew:

$ brew tap miry/medup
$ brew install medup

Run export command for Medium author miry and save articles to local folder:

$ medup -u miry -d .
$ medup -d .


Docker way to make same job:

$ docker run -v <path to local articles folder>:/posts -it miry/medup -u <user>

Download all articles that user has recommended:

$ docker run -v <path to local articles folder>:/posts -it miry/medup -u <user> --recommended -d posts/recommended


Run dumping with source code

$ shards install
$ crystal run src/ -- -u <medium user> -d <destination folder>

Example download all posts from author to local folder posts/miry

$ crystal run src/ -- -u miry -d posts/miry


Build a application binary and execute:

$ shards install
$ rake build
$ _output/medup -u <medium user> -d <destination folder>


By default all articles destination folder is posts.

In the directory, you can find 2 format of files: .json and .md.

  • JSON format is the raw, what Medium returns.
  • Markdown format is simple implementation of block formated text.

Images encoded in the result document. IFRAME content are located in posts/assets.


Example of exported document (Original Medium post vs Exported Markdown):


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request



This project is under the LGPL-3.0 license.

Play ownself

Medium API

  1. Medium API documentation

  2. Generate token on the page

  3. Create environment variable MEDIUM_TOKEN=<token>

  4. Verify token with sample query:

$ curl -H "Authorization: Bearer <token>"
{"data":{"id":"number","username":"miry","name":"Michael Nikitochkin","url":"","imageUrl":"*KgbjgGnH-csHuB8j."}}


  1. Check public information not covered by API
$ curl "" | cut -c17- && : Remove in the front from response some strange JS code.
  1. Pagination
$ curl "" | cut -c17- && : Remove in the front from response some strange JS code.
  1. Post info
curl -s -H "Content-Type: application/json"\?format\=json\&limit\=100
  1. Stream
$ curl -s -H "Content-Type: application/json" "" | cut -c17-
$ curl -s -H "Content-Type: application/json" "" | cut -c17- > stream.json
$ cat stream.json| jq ".payload.references.Post[].title"
$ cat stream.json| jq ""
  1. Recommendations
$ curl -s -H "Content-Type: application/json" | cut -c17-
$ curl -s -H "Content-Type: application/json" "" | cut -c17-
github statistic
  • 9
  • 0
  • 4
  • 12
  • 5 days ago
  • December 1, 2019

GNU Lesser General Public License v3.0

Synced at

Tue, 29 Sep 2020 13:24:11 GMT