The API provides endpoints for Visual Keys NFT collection and token metadata, as well as on-the-fly image generation.
It serves metadata and images for NFT marketplaces.
- Query NFT collection metadata
- Query NFT token metadata
- Generate on-the-fly SVG/PNG images for NFTs
You can build and run the API using Java, Docker, or as a native executable.
Prerequisites:
- Java 23+
Steps:
./gradlew runFatJar
- Build the JAR:
./gradlew buildFatJar
- Build the Docker image:
docker build -t visualkey-api .
- Run the Docker container:
docker run -p 8080:8080 visualkey-api
Prerequisites:
- GraalVM JDK 24 with Native Image
Steps:
./gradlew nativeCompile
./build/native/nativeCompile/api
- Build the native image:
./gradlew nativeCompile
- Build the Docker image:
docker build -f Dockerfile-native -t visualkey-api-native .
- Run the Docker container:
docker run -p 8080:8080 visualkey-api-native
Variable | Description | Default |
---|---|---|
HTTP_HOST |
Host to bind the server | 0.0.0.0 |
HTTP_PORT |
Port to bind the server | 8080 |
ENVIRONMENT |
Server environment (local , prod ) |
local |
BEHIND_PROXY |
Set to true if behind a proxy |
false |
VISUAL_KEY_URL |
URL of the Visual Key frontend | http://localhost:4200 |
Example:
docker run -e HTTP_PORT=80 -p 80:80 visualkey-api
The API is documented in OpenAPI format.
When running locally, interactive API documentation is also available at the /swagger
endpoint.