Hashnode API

News API · Works globally · GraphQL · Developer blogging platform

TL;DR

The Hashnode API is a GraphQL endpoint that powers the Hashnode developer blogging platform. You can query public articles, publications, users, and tags using flexible GraphQL queries. Unlike REST APIs that return fixed responses, you specify exactly what fields you need — reducing payload size and API calls. Public queries require no authentication.

Quick start: https://api.hashnode.com/ (GraphQL endpoint)

No API key needed — just make a request!

How to Use This API

1. GraphQL Query — Recent Articles

POST https://api.hashnode.com/
Content-Type: application/json

{
  "query": "{ storiesFeed(type: HOT) { edges { node { title brief url } } } }"
}

2. JavaScript — Fetch Articles

const query = {
  query: `{
    storiesFeed(type: FEATURED) {
      edges {
        node {
          title
          brief
          url
          author { name }
        }
      }
    }
  }`
};
fetch('https://api.hashnode.com', {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify(query)
})
  .then(r => r.json())
  .then(d => console.log(d.data.storiesFeed.edges));

3. Python — Get Tag Feed

import requests, json

query = {
    "query": """{
        storiesFeed(type: HOT, tag: "javascript") {
            edges {
                node {
                    title
                    url
                    totalReactions
                }
            }
        }
    }"""
}
resp = requests.post('https://api.hashnode.com', json=query)
data = resp.json()
for edge in data['data']['storiesFeed']['edges']:
    n = edge['node']
    print(f"{n['title']} ({n['totalReactions']} reactions)")

Frequently Asked Questions

What is GraphQL?
GraphQL is a query language where you specify the exact fields you want. This reduces over-fetching (getting too much data) and under-fetching (not enough data).
What queries are available?
storiesFeed (articles), user, publication, tag, and search. The API supports filtering by tag, type (HOT, FEATURED, NEW), and pagination.
Can I use REST instead of GraphQL?
No, Hashnode only provides a GraphQL API. However, any HTTP client can POST GraphQL queries as JSON.
What information does each article return?
Title, brief (description), cover image URL, publication date, author info, tags, total reactions, comments count, and the article URL.

What You Can Build