Netzo Logo


Medium is an online publishing platform.


import { medium } from 'netzo/apis/medium.ts'

const api = medium({
  accessToken: Deno.env.get('MEDIUM_ACCESS_TOKEN'),


The medium factory function expects an object with the following, and returns an object with an API client api.

accessTokenstringDeno.env.get('MEDIUM_ACCESS_TOKEN')the token to use for authentication
Refer to the API documentation to get the required information.


The following examples assume you have created an api client instance.

Find publications

Find all publications a user is subscribed to, writes to, or edits.

const result = await api.users[USER_ID].publications.get<Publications>()
const resultData =

Get user

Get the authenticated user's info.

const result = await<User>()
const resultData =

Add post

Create a post to the authenticated user's profile.

const data: DataAddPost = {
  title: 'New Post',
  contentFormat: 'html',
  content: '<h1>New title</h1><p>This is new post content</p>'
const result = await api.users[AUTHOR_ID]<Post>(data)
const resultData =