Horoscopepe

Horoscopepe · GPT アクション

Horoscope API

API for retrieving horoscope forecasts, random horoscopes, and horoscope cards.

  • GET /randomGet a random horoscope forecast
  • GET /forecastGet a horoscope forecast
  • GET /cardGet a horoscope card
  • GET /zodiacGet zodiac sign based on birth date
元の API スキーマ
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Horoscope API",
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    },
    "description": "API for retrieving horoscope forecasts, random horoscopes, and horoscope cards."
  },
  "servers": [
    {
      "url": "https://horoscopepe.com/api",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/random": {
      "get": {
        "summary": "Get a random horoscope forecast",
        "operationId": "getRandomForecast",
        "tags": [
          "horoscope"
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved a random horoscope forecast, no require anything to work",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/forecast": {
      "get": {
        "summary": "Get a horoscope forecast",
        "operationId": "getForecast",
        "tags": [
          "horoscope"
        ],
        "parameters": [
          {
            "name": "seed",
            "in": "query",
            "description": "Required date of birth (format YYYY-MM-DD) to generate a personalized horoscope.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved a horoscope forecast, personalized if a birth date is provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or missing required parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/card": {
      "get": {
        "summary": "Get a horoscope card",
        "operationId": "getCard",
        "tags": [
          "horoscope"
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved a random horoscope card",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/zodiac": {
      "get": {
        "summary": "Get zodiac sign based on birth date",
        "operationId": "getZodiacSign",
        "tags": [
          "zodiac"
        ],
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "Birth date in YYYY-MM-DD format. Defaults to current date if not provided.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language for the zodiac sign. Defaults to \"es\" (Spanish) if not provided.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "es"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved the zodiac sign",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "zodiacSign": {
                      "type": "string",
                      "description": "The zodiac sign corresponding to the given birth date."
                    }
                  },
                  "example": {
                    "zodiacSign": "Aries"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid date format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Zodiac sign not found for the given date",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ForecastResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The horoscope forecast text."
          },
          "image": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "description": "The title of the horoscope card."
              },
              "path": {
                "type": "string",
                "description": "The URL path to the image."
              },
              "dimensions": {
                "type": "object",
                "properties": {
                  "width": {
                    "type": "integer",
                    "description": "Width of the card in pixels."
                  },
                  "height": {
                    "type": "integer",
                    "description": "Height of the card in pixels."
                  }
                }
              }
            }
          }
        },
        "example": {
          "message": "Today is a good day for new opportunities.",
          "image": {
            "title": "La Cariñosa",
            "path": "https://horoscopepe.com/cards/La-Cariñosa.png",
            "dimensions": {
              "width": 200,
              "height": 300
            }
          }
        }
      },
      "CardResponse": {
        "type": "object",
        "properties": {
          "image": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "description": "The title of the horoscope card."
              },
              "path": {
                "type": "string",
                "description": "The URL path to the image."
              },
              "dimensions": {
                "type": "object",
                "properties": {
                  "width": {
                    "type": "integer",
                    "description": "Width of the card in pixels."
                  },
                  "height": {
                    "type": "integer",
                    "description": "Height of the card in pixels."
                  }
                }
              }
            }
          }
        },
        "example": {
          "image": {
            "title": "La Cariñosa",
            "path": "https://horoscopepe.com/cards/La-Cariñosa.png",
            "dimensions": {
              "width": 200,
              "height": 300
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "A description of the error that occurred"
          }
        }
      }
    }
  }
}