Medium

Social writing platform. Minimal interface focused on writing and reader community.

CMSBlogSocial WritingPublishingMonetization
License
Commercial
Language
Web Platform
Pricing
基本機能無料
Official Site
Visit Official Site

CMS

Medium

Overview

Medium is a social writing platform featuring a minimal interface focused on writing and a reader community.

Details

Medium is an online publishing platform launched in 2012 by Twitter co-founder Evan Williams. With the philosophy of "Quality over clicks," it has evolved as a social platform connecting writers and readers.

Medium's greatest feature is the simplicity of the writing experience. By eliminating complex settings and customization, it provides an environment where you can focus purely on "writing." The editor is intuitive, allowing format settings just by selecting text. Images, embeds, and code blocks can be easily inserted.

The community features are also robust, with over 100 million monthly readers and more than 4 million writers participating. Features like "claps," highlights, and responses encourage interaction between readers and writers. The Partner Program, renewed in August 2023, adopts a monetization model that emphasizes originality and reader engagement.

Pros and Cons

Pros

  • Focus on writing: Simple interface with no setup required
  • Existing readership: Over 100 million monthly active readers
  • High SEO impact: Medium's high domain authority
  • Monetization possible: Article monetization through Partner Program
  • Social features: Claps, highlights, and response functions
  • Free to start: Basic features completely free
  • Mobile support: Excellent mobile apps and responsive design

Cons

  • Platform dependency: No complete content ownership
  • No customization: Cannot change design or layout
  • No custom domain: Only Medium.com subdomains
  • API limitations: Official API deprecated, no update functionality
  • Revenue instability: Earnings fluctuate greatly with algorithm changes
  • Difficult content migration: Complex migration to other platforms

Key Links

Usage Examples

Account Creation and Basic Setup

// Basic authentication using Medium API (deprecated API)
// Note: Official API is not recommended for new integrations

// How to get Integration Token:
// 1. Log in to Medium.com
// 2. Go to Settings → Integration tokens
// 3. Enter token name and click "Get token"

const MEDIUM_API_TOKEN = 'your-integration-token';
const API_BASE_URL = 'https://api.medium.com/v1';

// Set authentication headers
const headers = {
  'Authorization': `Bearer ${MEDIUM_API_TOKEN}`,
  'Content-Type': 'application/json',
  'Accept': 'application/json'
};

Publishing Articles (Using API)

// Get user information
async function getCurrentUser() {
  const response = await fetch(`${API_BASE_URL}/me`, {
    method: 'GET',
    headers: headers
  });
  
  const data = await response.json();
  return data.data;
}

// Publish a post
async function publishPost(userId, postData) {
  const post = {
    title: "How to Write Technical Articles on Medium",
    contentFormat: "html",
    content: `
      <h1>How to Write Technical Articles on Medium</h1>
      <p>Medium is a great platform for technical writers.</p>
      <h2>Why Medium?</h2>
      <ul>
        <li>Reach to existing readership</li>
        <li>Simple writing experience</li>
        <li>Monetization possibilities</li>
      </ul>
      <pre><code class="language-javascript">
      console.log('Hello, Medium!');
      </code></pre>
    `,
    tags: ["programming", "technical-writing", "medium"],
    publishStatus: "public", // "draft", "public", "unlisted"
    canonicalUrl: "https://your-blog.com/original-post"
  };

  const response = await fetch(
    `${API_BASE_URL}/users/${userId}/posts`,
    {
      method: 'POST',
      headers: headers,
      body: JSON.stringify(post)
    }
  );

  return await response.json();
}

Publishing to Publications

// Get user's publications list
async function getUserPublications(userId) {
  const response = await fetch(
    `${API_BASE_URL}/users/${userId}/publications`,
    {
      method: 'GET',
      headers: headers
    }
  );
  
  const data = await response.json();
  return data.data;
}

// Publish article to publication
async function publishToPublication(publicationId, postData) {
  const post = {
    title: "Best Practices for Team Development",
    contentFormat: "markdown",
    content: `
# Best Practices for Team Development

## Importance of Code Reviews

Effective code reviews are essential for team growth.

### Review Points
1. Code readability
2. Performance
3. Security
4. Test coverage

\`\`\`javascript
// Good practice
function calculateTotal(items) {
  return items.reduce((sum, item) => sum + item.price, 0);
}
\`\`\`
    `,
    tags: ["development", "team", "best-practices"],
    publishStatus: "draft"
  };

  const response = await fetch(
    `${API_BASE_URL}/publications/${publicationId}/posts`,
    {
      method: 'POST',
      headers: headers,
      body: JSON.stringify(post)
    }
  );

  return await response.json();
}

Image Upload

// Upload image to Medium
async function uploadImage(imageFile) {
  const formData = new FormData();
  formData.append('image', imageFile);

  const response = await fetch(`${API_BASE_URL}/images`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${MEDIUM_API_TOKEN}`
    },
    body: formData
  });

  const data = await response.json();
  return data.data.url; // Uploaded image URL
}

// Use image in article
const imageUrl = await uploadImage(imageFile);
const postContent = `
  <h1>Article with Image</h1>
  <img src="${imageUrl}" alt="Description" />
  <p>Image description text</p>
`;

RSS/XML Feed Utilization

// Fetch Medium RSS feed and embed in blog
async function fetchMediumFeed(username) {
  const FEED_URL = `https://medium.com/feed/@${username}`;
  
  // Using RSS parser library (e.g., rss-parser)
  const Parser = require('rss-parser');
  const parser = new Parser();
  
  try {
    const feed = await parser.parseURL(FEED_URL);
    
    // Get latest 5 posts
    const latestPosts = feed.items.slice(0, 5).map(item => ({
      title: item.title,
      link: item.link,
      pubDate: item.pubDate,
      creator: item.creator,
      content: item['content:encoded'],
      categories: item.categories
    }));
    
    return latestPosts;
  } catch (error) {
    console.error('RSS fetch error:', error);
  }
}

// Display post list on your website
function displayMediumPosts(posts) {
  const container = document.getElementById('medium-posts');
  
  posts.forEach(post => {
    const article = document.createElement('article');
    article.innerHTML = `
      <h3><a href="${post.link}" target="_blank">${post.title}</a></h3>
      <time>${new Date(post.pubDate).toLocaleDateString('en-US')}</time>
      <div>${post.content.substring(0, 200)}...</div>
      <a href="${post.link}" target="_blank">Read more</a>
    `;
    container.appendChild(article);
  });
}

Unofficial API Usage Examples

// Advanced features using unofficial Medium API
// (Note: Use third-party services at your own risk)

const UNOFFICIAL_API_KEY = 'your-api-key';
const UNOFFICIAL_API_URL = 'https://api.mediumapi.com/v1';

// Get user details
async function getUserDetails(username) {
  const response = await fetch(
    `${UNOFFICIAL_API_URL}/user/${username}`,
    {
      headers: {
        'x-api-key': UNOFFICIAL_API_KEY
      }
    }
  );
  
  return await response.json();
}

// Get article statistics
async function getArticleStats(articleId) {
  const response = await fetch(
    `${UNOFFICIAL_API_URL}/article/${articleId}/stats`,
    {
      headers: {
        'x-api-key': UNOFFICIAL_API_KEY
      }
    }
  );
  
  const stats = await response.json();
  return {
    views: stats.views,
    reads: stats.reads,
    claps: stats.claps,
    responses: stats.responses_count
  };
}

// Search top writers
async function searchTopWriters(topic) {
  const response = await fetch(
    `${UNOFFICIAL_API_URL}/topwriters/${topic}`,
    {
      headers: {
        'x-api-key': UNOFFICIAL_API_KEY
      }
    }
  );
  
  return await response.json();
}