{"id":13514246,"url":"https://github.com/fedeperin/potterapi","last_synced_at":"2026-02-25T02:33:06.282Z","repository":{"id":212720944,"uuid":"731420531","full_name":"fedeperin/potterapi","owner":"fedeperin","description":"A REST Harry Potter API with images and information about books, characters and spells. Translated to many languages.","archived":false,"fork":false,"pushed_at":"2025-02-14T01:51:38.000Z","size":8602,"stargazers_count":84,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-20T07:05:22.505Z","etag":null,"topics":["api","espanol","express-api","expressjs","francais","french","french-language","french-translation","harry-potter","harry-potter-api","harrypotter","italian","portuguese","potter","potter-api","rest","rest-api","serverless-functions","spanish","vercel-deployment"],"latest_commit_sha":null,"homepage":"https://potterapi-fedeperin.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fedeperin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-14T03:32:23.000Z","updated_at":"2025-05-19T00:21:17.000Z","dependencies_parsed_at":"2023-12-23T00:49:32.079Z","dependency_job_id":"66dc092a-9600-4b96-971e-529f46a42cc1","html_url":"https://github.com/fedeperin/potterapi","commit_stats":null,"previous_names":["fedeperin/potterapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fedeperin/potterapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedeperin%2Fpotterapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedeperin%2Fpotterapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedeperin%2Fpotterapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedeperin%2Fpotterapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fedeperin","download_url":"https://codeload.github.com/fedeperin/potterapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedeperin%2Fpotterapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29809086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T22:43:48.403Z","status":"online","status_checked_at":"2026-02-25T02:00:07.329Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","espanol","express-api","expressjs","francais","french","french-language","french-translation","harry-potter","harry-potter-api","harrypotter","italian","portuguese","potter","potter-api","rest","rest-api","serverless-functions","spanish","vercel-deployment"],"created_at":"2024-08-01T05:00:50.414Z","updated_at":"2026-02-25T02:33:06.252Z","avatar_url":"https://github.com/fedeperin.png","language":"JavaScript","readme":"# PotterAPI\n\u003e [!IMPORTANT]  \n\u003e The new base URL is [https://potterapi-fedeperin.vercel.app](https://potterapi-fedeperin.vercel.app/) but you can still use the old one (not recommended) [https://potterapi.onrender.com/](https://potterapi.onrender.com/)  \n\n[PotterAPI](https://potterapi-fedeperin.vercel.app/) is a Harry Potter API developed with Express.js and available in multiple languages.  \nThis API stores information and images of books, characters and spells.\n\n## Live Documentation (Swagger UI)\n\nExplore the API and its endpoints interactively using our [Harry Potter API Documentation](https://vlaurencena.github.io/harry-potter-openapi-swagger-ui/).\n\n## Languages\nThis API is available in the following languages:\n- [`/en` English](https://potterapi-fedeperin.vercel.app/en)\n- [`/es` Español](https://potterapi-fedeperin.vercel.app/es)\n- [`/fr` Français](https://potterapi-fedeperin.vercel.app/fr)\n- [`/it` Italiano](https://potterapi-fedeperin.vercel.app/it)\n- [`/pt` Português](https://potterapi-fedeperin.vercel.app/pt)\n- [`/uk` Українська](https://potterapi-fedeperin.vercel.app/uk)\n\nIf there's any problem with the translations, you can [open an issue](https://github.com/fedeperin/potterapi/issues/new) or a [pull request](https://github.com/fedeperin/potterapi/pulls).\n\n## Endpoints\nThe endpoints are the following:  \n\u003csmall\u003eNote: The [lang] in the endpoint should be replaced by the corresponding language reference without the brackets (GET `/en/books` for example)\u003c/small\u003e\n\u003cdetails\u003e\n    \u003csummary\u003e\u003ccode\u003eGET /[lang]/books\u003c/code\u003e\u003c/summary\u003e\n    Returns information and images about Harry Potter books.\n    \u003ctable\u003e\n        \u003cthead\u003e\n            \u003ctr\u003e\n                \u003cth\u003eKey\u003c/th\u003e\n                \u003cth\u003eType\u003c/th\u003e\n                \u003cth\u003eValue\u003c/th\u003e\n            \u003c/tr\u003e\n        \u003c/thead\u003e\n        \u003ctbody\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003enumber\u003c/td\u003e\n                \u003ctd\u003eThe book number\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003etitle\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eThe title of the book in the selected language\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003eoriginalTitle\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eThe original book title in English\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003ereleaseDate\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eThe release date\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003edescription\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eA summary of the book\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003epages\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003enumber\u003c/td\u003e\n                \u003ctd\u003eThe original book's number of pages\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003ecover\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eAn URL to an image with the original cover of the book\u003c/td\u003e\n            \u003c/tr\u003e\n        \u003c/tbody\u003e\n    \u003c/table\u003e\n\u003c/details\u003e\n\u003cdetails\u003e\n    \u003csummary\u003e\u003ccode\u003eGET /[lang]/characters\u003c/code\u003e\u003c/summary\u003e\n    Returns information and images of Harry Potter characters.\n    \u003ctable\u003e\n        \u003cthead\u003e\n            \u003ctr\u003e\n                \u003cth\u003eKey\u003c/th\u003e\n                \u003cth\u003eType\u003c/th\u003e\n                \u003cth\u003eValue\u003c/th\u003e\n            \u003c/tr\u003e\n        \u003c/thead\u003e\n        \u003ctbody\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003efullName\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eThe full name of the character\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003enickname\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eThe nickname of the character\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003ehogwartsHouse\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eThe Hogwarts House this character belong to\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003einterpretedBy\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eThe name of the actor/actress the character was interpreted by in the movies\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003echildren\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003eobject\u003c/td\u003e\n                \u003ctd\u003eAn array with all the children of the character\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003eimage\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eAn URL to an image of the character\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003ebirthdate\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eThe birthdate of the character. Format \"Month Day, Year\"\u003c/td\u003e\n            \u003c/tr\u003e\n        \u003c/tbody\u003e\n    \u003c/table\u003e\n\u003c/details\u003e\n\u003cdetails\u003e\n    \u003csummary\u003e\u003ccode\u003eGET /[lang]/houses\u003c/code\u003e\u003c/summary\u003e\n    Returns the four Hogwarts Houses with some extra data\n    \u003ctable\u003e\n        \u003cthead\u003e\n            \u003ctr\u003e\n                \u003cth\u003eKey\u003c/th\u003e\n                \u003cth\u003eType\u003c/th\u003e\n                \u003cth\u003eValue\u003c/th\u003e\n            \u003c/tr\u003e\n        \u003c/thead\u003e\n        \u003ctbody\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003ehouse\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eName of the House\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003eemoji\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eAn emoji representing the house\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003efounder\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eThe name of the founder of the house\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003ecolors\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003eobject\u003c/td\u003e\n                \u003ctd\u003eAn array with the colors in english of the house\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003eanimal\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eThe animal of the house\u003c/td\u003e\n            \u003c/tr\u003e\n        \u003c/tbody\u003e\n    \u003c/table\u003e\n\u003c/details\u003e\n\u003cdetails\u003e\n    \u003csummary\u003e\u003ccode\u003eGET /[lang]/spells\u003c/code\u003e\u003c/summary\u003e\n    Returns all the spells mentioned in the saga with a description.\n    \u003ctable\u003e\n        \u003cthead\u003e\n            \u003ctr\u003e\n                \u003cth\u003eKey\u003c/th\u003e\n                \u003cth\u003eType\u003c/th\u003e\n                \u003cth\u003eValue\u003c/th\u003e\n            \u003c/tr\u003e\n        \u003c/thead\u003e\n        \u003ctbody\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003espell\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eThe name of the spell\u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\u003ccode\u003euse\u003c/code\u003e\u003c/td\u003e\n                \u003ctd\u003estring\u003c/td\u003e\n                \u003ctd\u003eDescription of the spell\u003c/td\u003e\n            \u003c/tr\u003e\n        \u003c/tbody\u003e\n    \u003c/table\u003e\n\u003c/details\u003e\n\u003c/br\u003e\nYou have to change the [lang] by one of the two-letter codes of the languages supported.\u003c/br\u003e\nEvery endpoint has a \u003ccode\u003e/random\u003c/code\u003e, which returns a random item of the full list. For example \u003ccode\u003e/en/spells/random\u003c/code\u003e returns a single random spell in English.\n\n## Params\nEvery endpoint (excluding the \u003ccode\u003e/random\u003c/code\u003es) can recieve the following query params: \n\nParam | Recieves | Description |\n----- | -------- | ----------- |\n`index` | number | Returns only one item, the one that on the whole list has the index selected |\n`max` | number | Returns the whole list cropped by the number passed |\n`page` | number | If `max` is used, you can also use this param to indicate where to start cropping |\n`search` | string | Searches in all the items and returns the best matches |\n\n## Examples\n### Javascript\n```javascript\nconst fetchSpells = async () =\u003e {\n    const res = await fetch('https://potterapi-fedeperin.vercel.app/en/spells')\n    const spells = await res.json()\n\n    return spells\n}\n```\n```javascript\nfetch('https://potterapi-fedeperin.vercel.app/es/characters?search=Weasley')\n    .then(res =\u003e res.json())\n    .then(res =\u003e {\n        console.log(res)\n    })\n```\n### Python\n```python\nimport requests\n\ndef get_book():\n    response = requests.get('https://potterapi-fedeperin.vercel.app/en/books')\n    books = response.json()\n    return books\n```\n\n## Running locally\n### Clone Repo:\nWith HTTPS\n```bash\n$ git clone https://github.com/fedeperin/potterapi.git\n```\nWith SSH\n```bash\n$ git clone git@github.com:fedeperin/potterapi.git\n```\n### Run in dev mode\nRun this to start a local server:\n```bash\n$ npm run dev\n```\n\n### Test\nBefore submitting a PR or making a commit run the following command:\n```bash\n$ npm run test\n```\n\n## Contributors\nThanks to our contributors for their time and effort\n\n\u003ca href=\"https://github.com/fedeperin\"\u003e\n    \u003cimg\n    src=\"./readme-assets/contributors/fedeperin.png\"\n    alt=\"fedeperin\"\n    width=\"50\"\n    height=\"50\"\n    style=\"border-radius: 50%;\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/vlaurencena\"\u003e\n\u003cimg\n    src=\"./readme-assets/contributors/vlaurencena.jpg\"\n    alt=\"vlaurencena\"\n    width=\"50\"\n    height=\"50\"\n    style=\"border-radius: 50%;\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/romsendz\"\u003e\n    \u003cimg\n    src=\"./readme-assets/contributors/romsendz.jpg\"\n    alt=\"romsendz\"\n    width=\"50\"\n    height=\"50\"\n    style=\"border-radius: 50%;\"\u003e\n\u003c/a\u003e\n\n## Previous APIs\nThis is a version that unifies my [Harry Potter API](https://github.com/fedeperin/harry-potter-api) and my [Harry Potter API English](https://github.com/fedeperin/harry-potter-api-english), also adding more info. This API is using Express.js instead of json-server.\n","funding_links":[],"categories":["Index"],"sub_categories":["Books"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedeperin%2Fpotterapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedeperin%2Fpotterapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedeperin%2Fpotterapi/lists"}