Back to Index

API Documentation

The API version of this instance is Version 1.
The base URL of all endpoints is https://hi.snaz.in/api/v1/.

The example JSON responses are not coming from the instance itself and may not have the same data.

Listing images

GET/list
Fetches a list of all the categories along with all of the filenames.

  // https://hi.snaz.in/api/v1/list

  {
    "categories": {
      "example_coffee": {
        "count": 6,
        "files": [
          "4GI-0z5K2i4_coffee.jpg",
          "bTzk95h707g_coffee.jpg",
          "hgjpLGClejo_coffee.jpg",
          "QDTtF7ewaak_coffee.jpg",
          "VwZyfdlvUWw_coffee.jpg",
          "_JOiT2NsV1A_coffee.jpg"
        ]
      },
      ...
    },
    "category_keys": [
      "example_coffee",
      ...
    ]
    "count": 4,
    "image_count": 10
  }
        
GET/:category/list
Fetches a list of filenames within a category.

  // https://hi.snaz.in/api/v1/example_coffee/list
        
  {
    "count": 6,
    "files": [
      "4GI-0z5K2i4_coffee.jpg",
      "bTzk95h707g_coffee.jpg",
      "hgjpLGClejo_coffee.jpg",
      "QDTtF7ewaak_coffee.jpg",
      "VwZyfdlvUWw_coffee.jpg",
      "_JOiT2NsV1A_coffee.jpg"
    ]
  }
        

Getting random images

GET/random
Redirects you to a random image in the instance.
GET/random.json
Fetches a random image in the instance.

  // https://hi.snaz.in/api/v1/random.json
        
  {
    "category": "example_coffee",
    "filename": "QDTtF7ewaak_coffee.jpg",
    "url": "https://hi.snaz.in/example_coffee/QDTtF7ewaak_coffee.jpg"
  }
        

Getting random images from a category

GET/:category/random
Redirects you to a random image in the instance.
GET/:category/random.json
Fetches a random image in the instance.

  // https://hi.snaz.in/api/v1/example_coffee/random.json
        
  {
    "category": "example_coffee",
    "filename": "bTzk95h707g_coffee.jpg",
    "url": "https://hi.snaz.in/example_coffee/bTzk95h707g_coffee.jpg"
  }
        

Badges

Image Count: https://hi.snaz.in/badge/image_count
Category Count: https://hi.snaz.in/badge/category_count
Image Count in a Category: https://hi.snaz.in/badge/octodex/image_count


?logo Adds a logo to the front of the label.
?domain Adds the host domain to the front of the label.
?style=flat Sets the style of the badge. Available styles: flat, flat-square, for-the-badge, plastic, social
?color=f00 Overrides the badge color. Can use HEX codes and CSS names.