{"id":19979081,"url":"https://github.com/enginebai/pymedium","last_synced_at":"2025-08-23T03:03:53.838Z","repository":{"id":53668190,"uuid":"75353286","full_name":"enginebai/PyMedium","owner":"enginebai","description":"Unofficial Medium Python Flask API and SDK","archived":false,"fork":false,"pushed_at":"2021-03-19T22:51:31.000Z","size":2584,"stargazers_count":163,"open_issues_count":8,"forks_count":19,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-30T22:13:57.887Z","etag":null,"topics":["api","flask","medium","python","sdk"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enginebai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-02T02:36:31.000Z","updated_at":"2025-02-21T15:48:58.000Z","dependencies_parsed_at":"2022-09-12T15:30:58.963Z","dependency_job_id":null,"html_url":"https://github.com/enginebai/PyMedium","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enginebai%2FPyMedium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enginebai%2FPyMedium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enginebai%2FPyMedium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enginebai%2FPyMedium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enginebai","download_url":"https://codeload.github.com/enginebai/PyMedium/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251789618,"owners_count":21644086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","flask","medium","python","sdk"],"created_at":"2024-11-13T03:36:25.954Z","updated_at":"2025-04-30T22:14:10.605Z","avatar_url":"https://github.com/enginebai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyMedium - Unofficial Medium API\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PyPI](https://badge.fury.io/py/PyMedium.svg)](https://badge.fury.io/py/PyMedium)\n\n![PyMedium](https://raw.githubusercontent.com/enginebai/PyMedium/master/art/graphic.png)\n\n*PyMedium* is an unofficial Medium API written in python flask. It provides developers to access to user, post list and detail information from [Medium](\nhttps://medium.com/) website. This is a read-only API to access public information from Medium, you can customize this API to fit your requirements and deploy on your own server.\n\n## Installation\nBefore running PyMedium API, you have to clone the code from this repository, install requirements at first.\n\n```shell\n$ git clone git@github.com:enginebai/PyMedium.git\n$ cd PyMedium\n$ pip install -r requirements.txt\n```\n\nThen download web driver to `driver` folder from [Selenium](http://selenium-python.readthedocs.io/) or via the command-line with `curl` (update `{VERSION}` with the latest version code and `{OS}` with your server operating system.\n\n```shell\n$ mkdir driver | cd driver\n$ curl -O https://chromedriver.storage.googleapis.com/{VERSION}/chromedriver_{OS}.zip\n$ unzip chromedriver_{OS}.zip\n```\n\n## Usage\nTo run this API application, use the `flask` command as same as [Flask Quickstart](http://flask.pocoo.org/docs/0.12/quickstart/)\n\n```shell\n$ export FLASK_APP=./pymedium/api.py\n$ export FLASK_DEBUG=1 ## if you run in debug mode.\n$ flask run\n * Running on http://localhost:5000/\n```\n\n## Documentation\n\n### Users\n* `GET /@{username}` - Get user profile\n\n#### Response\n```json\n{\n  \"avatar\": \"1*Y7zH0UM975YmchIO86uIGA.jpeg\",\n  \"bio\": \"Mixtape of developer, designer and startup. Cofounder and developer of DualCores Studio. Follow my technical blog: http://enginebai.logdown.com/\",\n  \"display_name\": \"Engine Bai\",\n  \"facebook\": \"789985027713671\",\n  \"followedby_count\": 445,\n  \"following_count\": 238,\n  \"publications\": [\n    {\n      \"creator_user_id\": \"3301d32a6bba\",\n      \"description\": \"Stories from the mix of designer and developer. 設計與工程的交織，混搭激盪出不同的想像。\",\n      \"display_name\": \"DualCores Studio\",\n      \"follower_count\": 302,\n      \"image\": {\n        \"image_id\": \"1*DLixNgsMpK5B74na3EDucQ.png\",\n        \"original_height\": 591,\n        \"original_width\": 591\n      },\n      \"logo\": {\n        \"image_id\": \"1*DLixNgsMpK5B74na3EDucQ.png\",\n        \"original_height\": 591,\n        \"original_width\": 591\n      },\n      \"name\": \"dualcores-studio\",\n      \"post_count\": 0,\n      \"publication_id\": \"275e26e7c1b2\",\n      \"url\": \"https://medium.com/dualcores-studio\"\n    },\n    ...more\n  ],\n  \"twitter\": \"enginebai\",\n  \"user_id\": \"3301d32a6bba\",\n  \"username\": \"enginebai\"\n}\n```\n\n### Publication\n* `GET /{publication_name}` - Get publication profile\n\n```json\n{\n  \"creator_user_id\": \"3301d32a6bba\",\n  \"description\": \"Stories from the mix of designer and developer. 設計與工程的交織，混搭激盪出不同的想像。\",\n  \"display_name\": \"DualCores Studio\",\n  \"follower_count\": 302,\n  \"image\": {\n    \"image_id\": \"1*DLixNgsMpK5B74na3EDucQ.png\",\n    \"original_height\": 591,\n    \"original_width\": 591\n  },\n  \"logo\": {\n    \"image_id\": \"1*DLixNgsMpK5B74na3EDucQ.png\",\n    \"original_height\": 591,\n    \"original_width\": 591\n  },\n  \"name\": \"dualcores-studio\",\n  \"post_count\": 0,\n  \"publication_id\": \"275e26e7c1b2\",\n  \"url\": \"https://medium.com/dualcores-studio\"\n}\n```\n\n### Post\n* `GET /@{username}/posts` - Get user latest posts\n* `GET /{publication_name}/posts` - Get publication latest posts\n* `GET /top` - Get most popular today posts\n* `GET /tags/{tag}` - Get tagged in popular posts\n* `GET /tags/{tag}/latest` - Get tagged in latest posts\n\n#### Parameters\n|Name   |Type   |Description   |\n|---|---|---|\n|n   |integer   |The count of posts to return. Default is 10.   |\n\n#### Response\n```json\n[\n  {\n    \"image_count\": 14,\n    \"post_date\": 1478533474858,\n    \"post_id\": \"99a3d86df228\",\n    \"preview_image\": {\n      \"image_id\": \"1*zhnQJhNzp-Oal1-GU1EUKw.png\",\n      \"original_height\": 412,\n      \"original_width\": 608\n    },\n    \"read_time\": 7.74811320754717,\n    \"recommend_count\": 351,\n    \"response_count\": 10,\n    \"title\": \"Make an android custom view, publish and open source.\",\n    \"url\": \"https://medium.com/dualcores-studio/make-an-android-custom-view-publish-and-open-source-99a3d86df228\",\n    \"word_count\": 1669\n  },\n  ...more\n]\n```\n\n### Post detail\n* `GET /post` - Get the post content\n\n#### Parameters\n|Name   |Type   |Description   |\n|---|---|---|\n|u   |string   |The post url to parse content.   |\n|format   |string   |(optional) The format of response, the value could be `text`, `html`, `md`, `json`, default is `text`.   |\n\n#### Response\n\n```\n## Simple text, json, html, markdown format\n```\n\n\n## Issues\nFeel free to submit bug reports or feature requests and make sure you read the contribution guideline before opening any issue.\n\n\n## Contributing\n1. Check the open/close issues or open a fresh issue for feature request or bug report with different labels (`feature`/`bug`).\n2. Fork this [repository](https://github.com/enginebai/PyMedium) on GitHub to start customizing on master or new branch.\n3. Write a test which shows that the feature works as expected or the bug was fixeed.\n4. Send a pull request and wait for code review.\n\n[Read more on contributing](./CONTRIBUTING.md).\n\nLicense\n-------\n\nCopyright (c) 2017 Engine Bai\nLicensed under the [MIT license](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenginebai%2Fpymedium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenginebai%2Fpymedium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenginebai%2Fpymedium/lists"}