Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thatfiredev/dc-villains-api
REST API listing villains and anti-heroes published by DC Comics
https://github.com/thatfiredev/dc-villains-api
Last synced: 9 days ago
JSON representation
REST API listing villains and anti-heroes published by DC Comics
- Host: GitHub
- URL: https://github.com/thatfiredev/dc-villains-api
- Owner: thatfiredev
- License: mit
- Created: 2020-06-25T14:09:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-16T00:12:11.000Z (over 4 years ago)
- Last Synced: 2024-10-19T02:14:12.292Z (2 months ago)
- Language: JavaScript
- Size: 118 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DC Villains and Anti-heroes API
Open Source REST API listing villains and anti-heroes published by DC Comics.
Data scrapped from [akabab/superhero-api](https://github.com/akabab/superhero-api).
## Available endpoints
### Get all characters
```bash
curl https://rosariopfernandes.github.io/dc-villains-api/all/
```### Get characters with pagination
This returns 10 characters per page. It uses the
[cursoring](https://developer.twitter.com/en/docs/basics/cursoring)
technique.
```bash
curl https://rosariopfernandes.github.io/dc-villains-api/cursor/# to call the next page:
curl https://rosariopfernandes.github.io/dc-villains-api/cursor/{next_cursor}/
```### Get character by id
```bash
curl https://rosariopfernandes.github.io/dc-villains-api/id/{id}/
# eg. curl https://rosariopfernandes.github.io/dc-villains-api/id/20/
```## Contributing with more characters
1. Check if the character has an ID on the [superheroapi](https://superheroapi.com/ids.html).
2. If it doesn't, choose an ID higher than 731. I recommend checking the [id/](/id) directory
and incrementing the last id (ascending order).
3. Create a new directory under the [id/](/id) directory and add an `index.json` file:
```bash
mkdir id/{YOUR_CHARACTER_ID}
touch id/{YOUR_CHARACTER_ID}/index.json
```
4. Add the character data to the index.json file and run the generator:
```bash
node scripts/generate_api.js
```
5. Commit the file you created and the generated files and send a PR.## License
[MIT License](LICENSE)