Unofficial Medium Python Flask API and SDK

Overview

PyMedium - Unofficial Medium API

License: MIT PyPI

PyMedium

PyMedium is an unofficial Medium API written in python flask. It provides developers to access to user, post list and detail information from Medium 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.

Installation

Before running PyMedium API, you have to clone the code from this repository, install requirements at first.

$ git clone [email protected]:enginebai/PyMedium.git
$ cd PyMedium
$ pip install -r requirements.txt

Then download web driver to driver folder from Selenium or via the command-line with curl (update {VERSION} with the latest version code and {OS} with your server operating system.

$ mkdir driver | cd driver
$ curl -O https://chromedriver.storage.googleapis.com/{VERSION}/chromedriver_{OS}.zip
$ unzip chromedriver_{OS}.zip

Usage

To run this API application, use the flask command as same as Flask Quickstart

$ export FLASK_APP=./pymedium/api.py
$ export FLASK_DEBUG=1 ## if you run in debug mode.
$ flask run
 * Running on http://localhost:5000/

Documentation

Users

  • GET /@{username} - Get user profile

Response

{
  "avatar": "1*Y7zH0UM975YmchIO86uIGA.jpeg",
  "bio": "Mixtape of developer, designer and startup. Cofounder and developer of DualCores Studio. Follow my technical blog: http://enginebai.logdown.com/",
  "display_name": "Engine Bai",
  "facebook": "789985027713671",
  "followedby_count": 445,
  "following_count": 238,
  "publications": [
    {
      "creator_user_id": "3301d32a6bba",
      "description": "Stories from the mix of designer and developer. 設計與工程的交織,混搭激盪出不同的想像。",
      "display_name": "DualCores Studio",
      "follower_count": 302,
      "image": {
        "image_id": "1*DLixNgsMpK5B74na3EDucQ.png",
        "original_height": 591,
        "original_width": 591
      },
      "logo": {
        "image_id": "1*DLixNgsMpK5B74na3EDucQ.png",
        "original_height": 591,
        "original_width": 591
      },
      "name": "dualcores-studio",
      "post_count": 0,
      "publication_id": "275e26e7c1b2",
      "url": "https://medium.com/dualcores-studio"
    },
    ...more
  ],
  "twitter": "enginebai",
  "user_id": "3301d32a6bba",
  "username": "enginebai"
}

Publication

  • GET /{publication_name} - Get publication profile
{
  "creator_user_id": "3301d32a6bba",
  "description": "Stories from the mix of designer and developer. 設計與工程的交織,混搭激盪出不同的想像。",
  "display_name": "DualCores Studio",
  "follower_count": 302,
  "image": {
    "image_id": "1*DLixNgsMpK5B74na3EDucQ.png",
    "original_height": 591,
    "original_width": 591
  },
  "logo": {
    "image_id": "1*DLixNgsMpK5B74na3EDucQ.png",
    "original_height": 591,
    "original_width": 591
  },
  "name": "dualcores-studio",
  "post_count": 0,
  "publication_id": "275e26e7c1b2",
  "url": "https://medium.com/dualcores-studio"
}

Post

  • GET /@{username}/posts - Get user latest posts
  • GET /{publication_name}/posts - Get publication latest posts
  • GET /top - Get most popular today posts
  • GET /tags/{tag} - Get tagged in popular posts
  • GET /tags/{tag}/latest - Get tagged in latest posts

Parameters

Name Type Description
n integer The count of posts to return. Default is 10.

Response

[
  {
    "image_count": 14,
    "post_date": 1478533474858,
    "post_id": "99a3d86df228",
    "preview_image": {
      "image_id": "1*zhnQJhNzp-Oal1-GU1EUKw.png",
      "original_height": 412,
      "original_width": 608
    },
    "read_time": 7.74811320754717,
    "recommend_count": 351,
    "response_count": 10,
    "title": "Make an android custom view, publish and open source.",
    "url": "https://medium.com/dualcores-studio/make-an-android-custom-view-publish-and-open-source-99a3d86df228",
    "word_count": 1669
  },
  ...more
]

Post detail

  • GET /post - Get the post content

Parameters

Name Type Description
u string The post url to parse content.
format string (optional) The format of response, the value could be text, html, md, json, default is text.

Response

## Simple text, json, html, markdown format

Issues

Feel free to submit bug reports or feature requests and make sure you read the contribution guideline before opening any issue.

Contributing

  1. Check the open/close issues or open a fresh issue for feature request or bug report with different labels (feature/bug).
  2. Fork this repository on GitHub to start customizing on master or new branch.
  3. Write a test which shows that the feature works as expected or the bug was fixeed.
  4. Send a pull request and wait for code review.

Read more on contributing.

License

Copyright (c) 2017 Engine Bai Licensed under the MIT license.

Owner
Engine Bai
Developer, Athlete, Learner.
Engine Bai
Total time of all YouTube videos in a playlist.

Youtube Playlist Total Times Total time of all YouTube videos in a playlist. How to Use Download chromedriver depending on your os and chrome version

Mohammad Dori 3 Jul 15, 2022
Telegram bot that let's you flip a coin in a dialog

coin_flip Telegram bot that let's you flip a coin in a dialog Report issue · Request feature About Software development tool that lets you finally dec

Ivan Akostelov 2 Dec 12, 2021
Telegram Vc Video Player Bot

Telegram Video Player Bot Telegram bot project for streaming video on telegram video chat, powered by tgcalls and pyrogram Deploy to Heroku 👨‍🔧 The

Dihan Official 11 Dec 25, 2022
A youtube search telegram bot.

YouTube-Search-Bot A youtube search telegram bot. Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License - https://github

Fayas Noushad 22 Nov 12, 2022
A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat.

TgTwitterStreamer A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat. For Getting ENV's Refer this Link

Anonymous 69 Dec 20, 2022
PyDottie is a version of Dottie.js written in Python 3.

PyDottie is a version of Dottie.js written in Python 3.

Jose Noriega 2 Nov 21, 2021
A simple anti-ghostping python bot made using diskord.

Anti Ghostping A simple Anti-Ghostping python bot made with ❤ using Diskord Requirements No one will use this but, all you need for this bot is: Pytho

RyZe 2 Sep 12, 2022
python3.5+ hubspot client based on hapipy, but modified to use the newer endpoints and non-legacy python

A python wrapper around HubSpot's APIs, for python 3.5+. Built initially around hapipy, but heavily modified. Check out the documentation here! (thank

Jacobi Petrucciani 140 Dec 21, 2022
A Telegram Bin Checker Bot made with python for check Bin valid or Invalid. 💳

Bin Checker Bot A Telegram Bin Checker Bot made with python for check Bin valid or Invalid. 📌 Deploy On Heroku 🏷 Environment Variables API_ID - Your

Chamindu Denuwan 20 Dec 10, 2022
Simple spam bot made in python

Simple Spam Bot A Simple and easy way to be the most hated person between your friends, All you have to do is spam the group chat using this bot until

Kareem Osama 6 Sep 05, 2022
this repo store a Awoesome telegram bot for protect from your large group from bot attack.

this repo store a Awoesome telegram bot for protect from your large group from bot attack.

Mehran Alam Beigi 2 Jul 22, 2022
Subtitle Translater

Subtitle Translater

OshadhaVimukthi 2 Nov 29, 2021
Maubot azuracast - A maubot to fetch data from your radio station

Maubot Azuracast A maubot to fetch data from your radio station Setup Configure

3 Mar 14, 2022
This is telegram bot to generate string session for using user bots. You can see live bot in https://telegram.dog/string_session_Nsbot

TG String Session Generate Pyrogram String Session Using this bot. Demo Bot: Configs: API_HASH Get from Here. API_ID Get from Here. BOT_TOKEN Telegram

Anonymous 27 Oct 28, 2022
Monetize your apps with KivAds using Google AdMob api.

KivAds(WIP) Monetize your apps with KivAds using Google AdMob api. KivAds uses the latest version of Google AdMob sdk(version 20.0.0). KivAds exposes

Guhan Sensam 16 Nov 05, 2022
The elegance of Airflow + the power of AWS

Orkestra The elegance of Airflow + the power of AWS

Stephan Fitzpatrick 42 Nov 01, 2022
A modular Telegram group management bot running with Python based on Pyrogram.

A modular Telegram group management bot running with Python based on Pyrogram.

Jefanya Efandchris 1 Nov 14, 2022
A project in order to analyze user's favorite musics, artists and genre

Spotify-Wrapped This is a project about Spotify Wrapped (which is an extra option for premium accounts, but you don't need to be premium here) This pr

Hossein Mohseni 19 Jan 04, 2023
Tamil Voicechat UserBot. Powerd By TamilBots. Https://T.me/TamilSupport

Tamil Voicechat UserBot A Telegram UserBot to Play music 🎶 in Voice Chats. It's recommended to use an USA number.(if your real number is suspended I'

Tamil Bots 78 Nov 01, 2022
SpamSMS - SPAM SMS menggunakan api web INDIHOME

SPAM SMS Unlimited SPAM SMS menggunakan api web INDIHOME Cara Install Di Termux

Zuck-Ker 1 Jan 08, 2022