Medium API

Personality / OAuth Advanced HTTPS
Varies by plan (check documentation)

Overview

The Medium API allows developers to publish posts, fetch user profiles, and manage publications on the Medium blogging platform. It uses OAuth 2.0 for authentication, which is a great way to learn industry-standard authorization flows. Note that the API has limited public endpoints — most functionality requires a user token obtained via OAuth.

💡

Beginner Tip

Start by creating an integration token in your Medium settings for quick testing before implementing full OAuth. Use the token as a Bearer token in your Authorization header.

Available Data

Medium data via REST API
JSON-formatted response data
Requires OAuth authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Medium",
    "description": "Community of readers and writers offering unique perspectives on ideas",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

data.id The unique identifier of the authenticated Medium user.
data.username The user's Medium username (appears in their profile URL).
data.name The user's display name on Medium.
data.url Full URL to the user's Medium profile page.
data.imageUrl URL of the user's profile avatar image.

Implementation Example

const url = "https://github.com/Medium/medium-api-docs";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "Authorization": "Bearer YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized Missing, expired, or incorrectly formatted Bearer token.
Include the header Authorization: Bearer YOUR_TOKEN and ensure your token has not expired.
403 Forbidden on publication posts Your user account does not have contributor access to the target publication.
Use your personal user ID as the target instead of a publication ID, or request contributor access.
400 Bad Request on POST /users/:id/posts The contentFormat field is invalid or the content field is empty.
Set contentFormat to "html" or "markdown" and provide a non-empty content string.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 3/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS UNKNOWN
Category Personality
Difficulty Advanced
Verified: 2026-04-04

Similar APIs

View All →