Harry Potter API

Harry Potter API

Media

The database of harry potter movies all characters, houses and spells. With a single /Get command you are able to fetch the characters, Hogwarts Houses and list of characters affiliated with the House. It also allows you to fetch all the spells performed in the Harry Potter season.

Visit API

📚 Documentation & Examples

Everything you need to integrate with Harry Potter API

🚀 Quick Start Examples

Harry Potter API Javascript Examplejavascript
// Harry Potter API API Example
const response = await fetch('https://www.potterapi.com/', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Introduction to PotterAPI

PotterAPI is a RESTful API that allows developers to access and retrieve data on the Harry Potter universe. The API has a wide range of endpoints, which provides information on characters, houses, spells, and more. The API is free to use and requires no authentication.

Getting Started

To get started, you need to register on the PotterAPI website to obtain an API key. Once you have your API key, you can use it to make requests to the desired endpoint. The API supports HTTP GET requests, and the responses are in JSON format.

Examples

Characters

To get information on a specific character, you can make a request to the /characters endpoint, followed by the character's name.

var characterName = "Harry Potter";
var apiUrl = "https://www.potterapi.com/v1/characters?key=[YOUR_API_KEY]&name=" + characterName;

fetch(apiUrl)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error(error));

Houses

To get information on a specific house, you can make a request to the /houses endpoint, followed by the house's name.

var houseName = "Gryffindor";
var apiUrl = "https://www.potterapi.com/v1/houses?key=[YOUR_API_KEY]&name=" + houseName;

fetch(apiUrl)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error(error));

Spells

To get information on a specific spell, you can make a request to the /spells endpoint, followed by the spell's name.

var spellName = "Lumos";
var apiUrl = "https://www.potterapi.com/v1/spells?key=[YOUR_API_KEY]&spell=" + spellName;

fetch(apiUrl)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error(error));

Conclusion

PotterAPI is an excellent resource for any Harry Potter fan or developer looking to build an application related to the Harry Potter universe. It provides a vast range of endpoints, which makes it a valuable tool for building exciting applications. Following the above examples, you can get started with using the PotterAPI and start to build some excellent applications.

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jul 5Jul 7Jul 9Jul 11Jul 13Jul 15Jul 17Jul 19Jul 21Jul 23Jul 25Jul 27Jul 29Jul 31Aug 304008001440Minutes
Online
Offline

Related APIs in Media