# medium-api-npm

> Get all your medium articles and display in your website or create an article and post it from your website and many more awesome stuff

Latest version **2.0.0** (published 2022-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install medium-api-npm
pnpm add medium-api-npm
yarn add medium-api-npm
bun add medium-api-npm
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-04-14 |
| First published | 2020-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | KVSSK |
| Maintainers | reacter |
| Keywords | medium, medium-article, get-medium-articles, medium-npm |

## Links

- npm: https://www.npmjs.com/package/medium-api-npm
- Repository: https://github.com/kvssankar/medium-npm
- Homepage: https://github.com/kvssankar/medium-npm#readme
- Issues: https://github.com/kvssankar/medium-npm/issues
- npm.io page: https://npm.io/package/medium-api-npm

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.19.2

## Recent versions

- 2.0.0 (latest) — 2022-04-14
- 1.1.3 — 2020-06-25
- 1.1.2 — 2020-06-25
- 1.1.1 — 2020-06-25
- 1.1.0 — 2020-06-25
- 1.0.9 — 2020-06-24
- 1.0.8 — 2020-06-24
- 1.0.7 — 2020-06-24
- 1.0.6 — 2020-06-24
- 1.0.5 — 2020-06-24
- 1.0.4 — 2020-06-23
- 1.0.3 — 2020-06-23
- 1.0.2 — 2020-06-23
- 1.0.1 — 2020-06-23
- 1.0.0 — 2020-06-23

## README

# 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));

  
  
| Parameter       | Type         | Required?  | Description                                     |
| -------------   |--------------|------------|-------------------------------------------------|
| title           | string       | required   | The 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.  |
| contentFormat   | string       | required   | The format of the "content" field. There are two valid values, "html", and "markdown" |
| content         | string       | required   | The 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](https://medium.com/@katie/a4367010924e). If you want your title to appear on the post page, you must also include it as part of the post content.                |
| tags            | string array | optional   | Tags to classify the post. Only the first three will be used. Tags longer than 25 characters will be ignored.                                        |
| canonicalUrl    | string       | optional   | The original home of this content, if it was originally published elsewhere.                         |
| publishStatus   | enum         | optional   | The status of the post. Valid values are “public”, “draft”, or “unlisted”. The default is “public”.  |
| license         | enum         | optional   | The 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”. |
| notifyFollowers | bool         | optional   | Whether to notifyFollowers that the user has published. |


# *Enjoy blogging !*

---
_Source: https://npm.io/package/medium-api-npm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
