You can use Contaminative Moons to build your own funny stuff! Here's the document that will help you to use the API.

I'm not entirely sure if this can be called an API or not, but anyway, let's get started.

Endpoint

For this instance of Contaminative Moons, the endpoint is https://util.fiveyellowmice.com/contaminative-moons/gen-image.php. The only available methods are GET and HEAD. Any parameters described below should be present in application/x-www-form-urlencoded form as URI query.

Parameters

All parameters are required.

Width

Name width
Type Integer
Minimum value 0
Maximum value 3840

The width of the generated image.

Height

Name height
Type Integer
Minimum value 0
Maximum value 2160

The height of the generated image.

Count

Name count
Type Integer
Minimum value 0
Maximum value 512

Total number of moons.

Background

Name background
Type Enum
Available values black, white, transparent

Background color. Transparent is not available if format is JPEG.

Format

Name format
Type Enum
Available values jpeg, png, webp

The format of the generated image.

Moons

Name moons
Type String

This parameter describes how moons will be selected and shown. Because of its complexity, the format will be described later.

Moon settings

The moons parameter is an array delimited by semicoloms (;). Each item is constructed in this format:

moon_name,min_scale,max_scale

moon_name specifies which moon to use. It's a enum which can be one of these values:

min_scale and max_scale define the minimum and maximum scale a moon can have. They're both floats with a minimum value of 0 and maximum value of 128.

For example, the default settings in the web page (apple_new_moon_with_face, min scale is 0.15, max scale is 1), will be represented as apple_new_moon_with_face,0.15,1. If we want to add an apple_full_moon_with_face with the default settings, it will be apple_new_moon_with_face,0.15,1;apple_full_moon_with_face,0.15,1.

Error

In case there's an error, whether it's because of your parameters or the server's fault, a non-2xx status will be returned. And if the server managed to give you an error message, it will be returned in the response body in plain text.

Examples

Well, just go back to main page, open developer tools in your browser and switch to network tab. Look for requests to gen-image.php then see what URL that request have.

I'm being very kind to think that you are probably to lazy to do so, so I'll throw you the URL of the default setting:

https://util.fiveyellowmice.com/contaminative-moons/gen-image.php?width=800&height=600&count=16&background=black&format=jpeg&moons=apple_new_moon_with_face,0.15,1

Compatibility

The API may change with or without prior notice. But no need to worry, the old API will continue to work for some time period because when incompatible APIs are introduced, the endpoint will change.