API

The z1g Project has an API for fetching games and app information, that is used by Sodium and Ephemeral. The source code is available on GitHub.

Apps API

The Apps API returns app information from the database. The endpoint is https://api.z1g.top/api/apps. The response is a JSON object returning the status, and an array of apps.

Example Response:

{
  "status": "success",
  "data": [
    {
      "name": "Amazon",
      "description": "Free shipping on millions of items. Get the best of Shopping and Entertainment with Prime. ",
      "url": "https://amazon.com",
      // image API
      "image": "https://api.z1g.top/api/images?url=https://m.media-amazon.com/images/I/31epF-8N9LL.png&size=750&color=white",
      "icon": "https://m.media-amazon.com/images/I/31epF-8N9LL.png"
    }
    // more apps...
  ]
}

The type of the data property is as follows:

PropTypeDefault
name
string
-
description
string
-
url
string
-
image
string
-
icon
string
-

Errors

If there is an error with the request the API will return code 500 with the status error and an error object. The error object will contain a message and a detail property. Example Response:

{
  "status": "error",
  "error": {
    "message": "An error occurred while retrieving the apps",
    "detail": "<error message would go here>"
  }
}

Image API

The Image API is used to generate a 16:9 image from a square app icon. The endpoint is https://api.z1g.top/api/images. An example of this being used is here

The query parameters are as follows:

url: The URL of the image to be resized.

size: This will be the width and height of the image displayed on the image

color: The color of the background of the image. This can be either black or white.

Last updated on

On this page

Edit on GitHub