zg.is API v1

Z Generate

API version 1

Free image hosting & upload API

Getting Started

The Z Generate API allows you to upload images. API calls can be made using POST or GET request methods. Since GET requests are limited by URL length, prefer POST.

Base URL

https://zg.is/1/upload

Authenticate by passing your API key as the key parameter.

API Key

c2c63d156c6baa11136a464dcd22a404

POST Image Upload

https://zg.is/1/upload

Parameters

Parameter Type Required Description
key string required The API key.
image string/file required A binary file, base64 data, or an image URL. Max 32 MB.
name string optional The name of the file. Auto-detected if uploading via multipart.
expiration number optional Auto-delete after this many seconds (60 - 15552000).

Supported formats: JPEG, PNG, GIF, WebP, BMP, TIFF

Example Request

curl --location --request POST \
  "https://zg.is/1/upload?expiration=600&key=YOUR_API_KEY" \
  --form "image=@/path/to/image.jpg"

Base64 upload:

curl --location --request POST \
  "https://zg.is/1/upload?key=YOUR_API_KEY" \
  --form "image=R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"

Example Response JSON

{
  "data": {
    "id": "2ndCYJK",
    "title": "c1f64245afb2",
    "url_viewer": "https://zg.is/i/2ndCYJK",
    "url": "https://zg.is/i/2ndCYJK/c1f64245afb2.gif",
    "display_url": "https://zg.is/i/2ndCYJK/c1f64245afb2.gif",
    "width": "1",
    "height": "1",
    "size": "42",
    "time": "1552042565",
    "expiration": "0",
    "image": {
      "filename": "c1f64245afb2.gif",
      "name": "c1f64245afb2",
      "mime": "image/gif",
      "extension": "gif",
      "url": "https://zg.is/i/2ndCYJK/c1f64245afb2.gif"
    },
    "thumb": {
      "filename": "c1f64245afb2.gif",
      "name": "c1f64245afb2",
      "mime": "image/gif",
      "extension": "gif",
      "url": "https://zg.is/i/2ndCYJK/c1f64245afb2.gif"
    },
    "medium": {
      "filename": "c1f64245afb2.gif",
      "name": "c1f64245afb2",
      "mime": "image/gif",
      "extension": "gif",
      "url": "https://zg.is/i/2ndCYJK/c1f64245afb2.gif"
    },
    "delete_url": "https://zg.is/i/2ndCYJK/670a7e48ddcb85ac340c717a41047e5c"
  },
  "success": true,
  "status": 200
}

Error Responses

Status Code Description
401 100 Invalid API key.
400 200 Image is required.
400 300 Upload failed (unsupported format, size exceeded, etc).

This API is compatible with the ImgBB API v1 format.

Existing ImgBB client libraries work by changing the base URL to https://zg.is