Welcome to the official documentation for the Character Generator API. This API empowers you to dynamically generate distinct characters, complete with metadata and associated images. Below is an extensive guide on effectively utilising this API.
To generate characters, manipulate the seed value in the URL, determining the character’s properties. Repeating the same seed will yield the identical character. Below are quick links for testing:
Note: Version 2 is currently in progress.
Follow these instructions to get a copy of the project up and running on your local machine.
Clone the repository:
git clone https://github.com/ITsPorky/Character-Generation-API.git
Navigate to the project directory:
cd Character-Generation-API
Install dependencies:
npm install
OR
npm i
Start the development server:
npm start
Open your browser and visit http://localhost:3000 to view the app.
This API provides various response types for creating diverse characters. It includes different versions for generating distinct styles of character design:
.png
)To obtain a Character Card, use the following URL format: /v1/card/seed/{seed_value}/1x.png
.
/v1
instructs the API to use version 1 style./card
instructs the API to generate the card format./seed
indicates character generation based on a given seed value.{seed_value}
should be a hexadecimal value (0-9 and a-f) determining the character’s properties./1x.png
returns the default-sized Character Card. You can adjust the size with /2x.png
or other options (up to 5x.png
), but note that larger images may strain the API server.Example Response:
.png
)To retrieve a Character Sprite, use the URL format: /v1/sprite/seed/{seed_value}/1x.png
.
/v1
instructs the API to use version 1 style./sprite
generates only the character sprite./seed
specifies the seed value.{seed_value}
is the hexadecimal seed value./1x.png
provides the default size of the Character Sprite, adjustable as needed (up to 10x.png
).Example Response:
.png
)To obtain a Weapon Sprite, use the URL format: /v1/weapon/seed/{seed_value}/1x.png
.
/v1
instructs the API to use version 1 style./weapon
generates only the weapon sprite./seed
specifies the seed value.{seed_value}
is the hexadecimal seed value./1x.png
provides the default size of the Weapon Sprite, adjustable as needed (up to 10x.png
).Example Response:
JSON
)To retrieve Character Metadata, use the URL format: /v1/seed/{seed_value}/metadata
.
/v1
instructs the API to use version 1 style./seed
generates character data for a given seed value.{seed_value}
is the seed value for character generation.metadata
instructs the API to return the metadata JSON.This response includes all generated character information, such as character card URL, character sprite URL, weapon sprite URL, and additional data not displayed on the character card.
Work in progress…
This API provides numerous features for creating unique characters, including:
This section provides an overview of the key learnings and challenges encountered during the development of this project.
Throughout the course of this project, I acquired valuable skills and knowledge in the following areas:
In the pursuit of project completion, several challenges were encountered and successfully addressed:
I hope this documentation was helpful, feel free to try it out.