A RESTful OPEN API for the Wizarding World.
Access data about characters, creatures, schools, and houses through a simple JSON interface.
https://harry-potter-open-api-ff4c7a51ed23.herokuapp.com- Browse the API in Scalar at
/docs. - The OpenAPI source served by the app is available at
/openapi.yaml. - The checked-in OpenAPI file is now the documentation source of truth, alongside
config/routes.rb. - Student routes are intentionally excluded from the current docs because the nested route is marked broken in
config/routes.rband there is no matchingStudentsControllerimplementation inapp/controllers/api/v1.
We welcome all contributions: bug fixes, data contributions, and magical recommendations!
1. Fork & Clone
First, fork the project to your personal account. Then clone it:
git clone git@github.com:yourAccount/harry_potter_open_api.git
cd harry_potter_open_api2. Dependencies & Database
Make sure you have the correct Ruby and Rails versions installed.
-
Configure Database:
Create aconfig/database.ymlfile with your local settings.
Use this guide for reference. -
Install Gems:
bundle install
-
Setup Database:
rails db:create rails db:migrate
3. Import Magical Data (Seeding)
Populate your local database using the custom Excel importer task:
bundle exec rake hp_data:buildNote: This parses the
data.xlsxfile and populates tables ensuring no duplicates.
4. Run the Server
rails sAccess the API at http://localhost:3000/api/v1/...
Docs are available locally at http://localhost:3000/docs.
- Add Wizard Professions model
- Add Spells model
- Add Potions model
- Add filtering and pagination
Special thanks to these resources for keeping the magic alive:
- Harry Potter Wiki - For the lore and information.
- Wizards Unite Hub - For database resources.
- Szokekiss Marton - For the amazing creature illustrations.
This project is available as open source under the terms of the MIT License.
If this project bring you value, you can support me here: