2.0.0 • Published 2 years ago

medium-api-npm v2.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

medium-api-npm

Get your medium articles and display in your website or write an article and post it from your website.

0. To get auth-code:

 Go to your medium account -> profile icon -> settings -> integration tokens -> generate token

1. To fetch user data, posts, publications from medium:

const { getMediumArticles } =  require("medium-api-npm");
getMediumArticles({
  auth: "auth-code",
}).then((data) => console.log(data));

2. To add a post to medium:

const { addPost } =  require("medium-api-npm");
addPost({
  auth: "auth-code",
  title: "test",
  html: "<p>test</p>",
  canonicalUrl: "https://medium.com/@test",
  tags: ["test"],
  publishStatus: "draft",
}).then((data) => console.log(data));
ParameterTypeRequired?Description
titlestringrequiredThe title of the post. Note that this title is used for SEO and when rendering the post as a listing, but will not appear in the actual post—for that, the title must be specified in the content field as well. Titles longer than 100 characters will be ignored. In that case, a title will be synthesized from the first content in the post when it is published.
contentFormatstringrequiredThe format of the "content" field. There are two valid values, "html", and "markdown"
contentstringrequiredThe body of the post, in a valid, semantic, HTML fragment, or Markdown. Further markups may be supported in the future. For a full list of accepted HTML tags, see here. If you want your title to appear on the post page, you must also include it as part of the post content.
tagsstring arrayoptionalTags to classify the post. Only the first three will be used. Tags longer than 25 characters will be ignored.
canonicalUrlstringoptionalThe original home of this content, if it was originally published elsewhere.
publishStatusenumoptionalThe status of the post. Valid values are “public”, “draft”, or “unlisted”. The default is “public”.
licenseenumoptionalThe license of the post. Valid values are “all-rights-reserved”, “cc-40-by”, “cc-40-by-sa”, “cc-40-by-nd”, “cc-40-by-nc”, “cc-40-by-nc-nd”, “cc-40-by-nc-sa”, “cc-40-zero”, “public-domain”. The default is “all-rights-reserved”.
notifyFollowersbooloptionalWhether to notifyFollowers that the user has published.

Enjoy blogging !

2.0.0

2 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago