RandomDuck

RandomDuck · GPT Actions

Random Duck Image API

This API provides random duck images and gifs, along with specific images based on numbers or HTTP status codes.

  • GET /randomReturns a random duck image or gif
  • GET /quackSame behavior as /random
  • GET /randomimgReturns a random image file
  • GET /listReturns a list of all available filenames
  • GET /{num}.jpgReturns an image file directly by number
  • GET /{num}.gifReturns a gif file directly by number
  • GET /http/{code}Returns an image file of a duck representing an HTTP status code
原始 API 定义
{
  "openapi": "3.0.0",
  "info": {
    "title": "Random Duck Image API",
    "description": "This API provides random duck images and gifs, along with specific images based on numbers or HTTP status codes.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://random-d.uk/api/v2",
      "description": "Version 2 of the API server"
    }
  ],
  "paths": {
    "/random": {
      "get": {
        "operationId": "getRandomImage",
        "summary": "Returns a random duck image or gif",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "GIF",
                "JPG"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON object containing a link to a random image",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/quack": {
      "get": {
        "operationId": "getQuackImage",
        "summary": "Same behavior as /random",
        "responses": {
          "200": {
            "description": "A JSON object containing a link to a random image",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/randomimg": {
      "get": {
        "operationId": "getRandomImageFile",
        "summary": "Returns a random image file",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "GIF",
                "JPG"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An image file",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/gif": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/list": {
      "get": {
        "operationId": "getListOfImages",
        "summary": "Returns a list of all available filenames",
        "responses": {
          "200": {
            "description": "A JSON object containing all filenames available",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "images": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "gifs": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "http": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "image_count": {
                      "type": "integer"
                    },
                    "gif_count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/{num}.jpg": {
      "get": {
        "operationId": "getImageByNumber",
        "summary": "Returns an image file directly by number",
        "parameters": [
          {
            "name": "num",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An image file",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/{num}.gif": {
      "get": {
        "operationId": "getGifByNumber",
        "summary": "Returns a gif file directly by number",
        "parameters": [
          {
            "name": "num",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A gif file",
            "content": {
              "image/gif": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/http/{code}": {
      "get": {
        "operationId": "getHttpImage",
        "summary": "Returns an image file of a duck representing an HTTP status code",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An image file representing an HTTP status code",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    }
  }
}