Convert Medium Articles to HTML
Published: 2023-09-24 16:15:00

Hey Guys!

We are happy to announce that we have added a new, powerful endpoint to Medium API to extend its functionality, called "**Get Article's HTML**". As the name suggests, this endpoint returns the Medium Article in plain HTML format.

_You can read more about its usage **[here](https://mediumapi.com/documentation.html#33ef).**_

In this article, we will explore the intricacies of the HTML structure obtained through the output of this new endpoint. We will dive deep into the underlying elements, classes, and tags that compose the structure of Medium articles.

In our discoveries, one of the major applications we have found of this endpoint is to sync up your Medium articles with your personal portfolio website.

If you don't want to build a backend just for publishing articles, then you can use Medium as your blogging backend. Medium API enables you to import/sync your Medium Articles with ease.

And understanding the structure of the output HTML will empower you to effortlessly adapt and style your imported Medium articles, ensuring they seamlessly blend with the unique design and layout of your website.

So let's get started!

* * *

**Quick refresh:** Here is the output of the "Article's HTML" endpoint.

![Image by the Author](https://miro.medium.com/0*ZlCWHAACPXYB4m_t.png)

* * *

Fullpage Parameter
------------------

Before we dive into each tag, an important aspect to note is the presence of the _**"fullpage"**_ parameter that you can use with this endpoint.

By toggling this parameter to **`true`**, you can obtain the complete HTML page, including the head, body, title, and meta tags.

Alternatively, setting it to **`false`** retrieves only the HTML content within the body.

![Medium API - Articles HTML - Fullpage Output](https://miro.medium.com/1*ffNfQbTRxe9ZpYxv4Ws3Xw.png)

![Medium API - Articles HTML - Body Output](https://miro.medium.com/1*_aSC20RkCIKCRvy77mkVzw.png)

Choosing to save the full HTML page (_fullpage = true_) provides additional information that can prove beneficial for various purposes, particularly in the realm of Search Engine Optimization (SEO).

You'll also notice the presence of multiple meta tags in the example. They are primarily used by search engines, social media platforms, and browsers to understand and display information about the webpage.

![Image by the Author](https://miro.medium.com/1*udfpJ3hUNYCMd3IrwZ5jJw.png)

These meta tags provide various types of information about the webpage, including its character encoding, compatibility mode, view-port settings, description, keywords, authorship, and information used by social media platforms when the page is shared.

Now let's come to the main part of the HTML.

* * *

Understanding the HTML Structure
--------------------------------

Here, we will take a closer look at the various tags present in the HTML structure of a Medium article.

From the eye-catching headings to the captivating images, the impactful quotes to the informative code blocks, we will examine the purpose and functionality of each tag.

Kicker, Title & Subtitle
------------------------

These elements form the backbone of an engaging Medium article by capturing the reader's attention and conveying the essence of the content.

The kicker acts as a catchy introduction, while the title succinctly summarizes the main topic. Subtitles provide additional context or highlight key aspects.

By utilizing the **`<h3>`**, **`<h1>`**, and **`<h3>`** tags respectively, these elements are given the prominence they deserve.

Here's an example:

![Medium Article's Title HTML Code](https://miro.medium.com/1*M13XN-lVAsFgWZ0dOpfaiA.png)

Images
------

Moving on to images - they enhance the visual appeal of an article and help convey information more effectively.

The **`<img>`** tag is used to insert images into the article, as seen in the example:

![Medium Image Embed HTML Code](https://miro.medium.com/1*IKsz53FD-1GvQVS6acH1hA.png)

Here, the **`alt`** text is taken from your Image's caption and **`src`** attribute specifies the Image's URL stored on Medium server.

Codeblocks
----------

Code snippets are an essential part of technical articles, as they allow readers to understand specific programming instructions.

To represent codeblocks in our HTML structure, the **`<pre>`** and **`<code>`** tags are utilized, providing a designated space for code content. And the **`class`** attribute allows you to specify the language for syntax highlighting.

![Medium Codeblocks HTML Code](https://miro.medium.com/1*e8uyPr3uXr5emOid_bcngQ.png)

By enclosing code within these tags, it maintains the formatting and preserves indentation, making it easier for readers to read and comprehend the code.

This ensures that code snippets are visually distinct from the surrounding text, allowing for better clarity and understanding.

Quotes
------

Quotes serve as powerful tools for emphasizing key statements or insights within an article.

In our HTML structure, quotes are represented using the **`<blockquote>`** tag.

This tag allows for the distinct styling and presentation of quoted content. By applying different classes, such as "_**big**_" or "_**small**_," you can make them stand out differently to capture the reader's attention.

![Medium Articles Quote HTML Code](https://miro.medium.com/1*6JSR6YtYBRqleF-i239_ew.png)

Basic Formatting
----------------

HTML tags like **`<b>`**, **`<i>`**, and **`<a>`** provide powerful means to format and enhance the textual content of Medium articles.

*   **`<b>`** tag is used to bold the text
*   **`<i>`** for making it italic
*   **`<a>`** for creating clickable hyperlinks

These tags allow us to apply emphasis, highlight important information, and seamlessly integrate external references within the article.

In the image, we can observe examples of both formatting and links:

![Medium Article Basic Formatting HTML Code](https://miro.medium.com/1*qA3HkuVXKKnRJ8gp4Cti3Q.png)

These examples showcase different combinations of **`<b>`** and **`<i>`** tags to create bold, italic, or both formatting styles applied to specific portions of the text.

The **`<a>`** tag is used to create a clickable hyperlink, where **`href`** attribute specifies the URL that the link should point to, and the text "**Link**" serves as the visible text for the hyperlink.

Lists
-----

Lists are valuable tools for organizing information in a structured and readable format within Medium articles.

Here, we have two types of lists:

*   ordered lists represented by the **`<ol>`** (ordered list) tag
*   unordered lists represented by the **`<ul>`** (unordered list) tag

![Lists in Medium Articles - HTML Code](https://miro.medium.com/1*JbIcj842lMMSEhVCIxQCdg.png)

In the ordered list example, the **`<ol>`** tag is used to create a numbered list. Each list item is represented by the **`<li>`** (list item) tag. The numbers indicate the sequence or order of the items.

In the unordered list example, the **`<ul>`** tag is used to create a bullet-point list. Similar to the ordered list, each item is represented by the **`<li>`** tag. However, in this case, the items are presented without any particular order or sequence.

Lists are particularly useful when presenting steps, instructions, bullet points, or any form of organized information.

They help readers easily digest and navigate through the content, improving the overall readability and comprehension of the article.

Inline Code
-----------

Inline code snippets are an important aspect of technical articles. They allow us to highlight and distinguish code within the regular text. In our HTML structure, the **`<code>`** tag is utilized to represent inline code snippets.

![Medium Story - Inline Code - HTML](https://miro.medium.com/1*jMoJIFbhG6Hbrx8ahPTgAQ.png)

This tag enhances the clarity and readability of our Medium articles, especially when discussing code-related concepts, syntax, or examples.

Embeds
------

Embedding external content in Medium articles elevates the level of interactivity, transforming them into immersive experiences. By seamlessly integrating dynamic elements such as code snippets, interactive widgets, or multimedia content, we captivate our readers and provide them with engaging and enriched articles.

In our HTML structure, different types of embeds get converted into different kinds of tags.

Let's see a couple of examples:

*   GitHub Gist Embed

![Gist Embed in Medium Article](https://miro.medium.com/1*FaJWYvKvZ6H2LntB6ZKIsg.png)

*   YouTube Video Embed

![YouTube Video Embed in Medium Article](https://miro.medium.com/1*V-cXe-kkFBiGP2xNCPT6Hg.png)

* * *

Final thoughts -
----------------

You have now acquired a thorough comprehension of the new **"Get Article's HTML"** endpoint in the Medium API, along with the wide array of tags encompassed in its output.

Armed with this knowledge, you can effortlessly incorporate the endpoint's output into your existing infrastructure, and even tailor your own custom CSS to align with your company's branding.

Should you have any inquiries, uncertainties, or suggestions regarding this endpoint or its output, please feel free to reach out to us at -

> [nishu@mediumapi.com](mailto:nishu@mediumapi.com)

_Thanks for reading and have a nice day!_