주식 투자 올인원

주식 투자 올인원 · Acciones GPT

FastAPI

  • POST /price-infoGet Price Information
  • POST /fundamental-summaryGet Fundamental Information
Esquema original API
{
  "openapi": "3.0.0",
  "info": {
    "title": "FastAPI",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://cherrypick.xn--hk3b17f.xn--3e0b707e",
      "description": "주식의 가격이나 거래 현황 그리고 per과 같은 간단한 재무지표를 확인할 수 있는 API"
    }
  ],
  "paths": {
    "/price-info": {
      "post": {
        "summary": "Get Price Information",
        "operationId": "getPriceInformation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceItem"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": null,
                "$ref": "#/components/schemas/HTTPValidationError"
              }
            }
          }
        }
      }
    },
    "/fundamental-summary": {
      "post": {
        "summary": "Get Fundamental Information",
        "operationId": "get_fundamental_information_fundamental_summary_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FundamentalItem"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "type": "object",
        "title": "HTTPValidationError",
        "properties": {
          "detail": {
            "type": "array",
            "title": "Detail",
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      },
      "PriceItem": {
        "type": "object",
        "title": "PriceItem",
        "required": [
          "question",
          "start_date",
          "end_date",
          "scale",
          "stock_code",
          "task"
        ],
        "properties": {
          "question": {
            "type": "string",
            "title": "Question",
            "description": "사용자가 gpt에 질문한 문장을 그대로 전달"
          },
          "start_date": {
            "type": "string",
            "title": "Start Date",
            "description": "조사하기를 원하는 기간의 시작하는 날짜를 yyyymmdd 형태로 전달"
          },
          "end_date": {
            "type": "string",
            "title": "End Date",
            "description": "조사하기를 원하는 기간의 끝나는 날짜를 yyyymmdd 형태로 전달"
          },
          "scale": {
            "type": "string",
            "title": "Scale",
            "description": "값의 단위를 의미하며 'd', 'm', 'y'가 들어올 수 있고 각각 일, 월, 연을 의미"
          },
          "stock_code": {
            "type": "array",
            "title": "Stock Code",
            "items": {
              "type": "string"
            },
            "description": "조사하기 원하는 주식의 종목코드로 이루어진 리스트로 예를 들면 ['035420', '005930'] 이와 같이 들어올 수 있음. 종목코드는 숫자 6자리로만 이루어져 있어야 하고 뒤에 :KRX는 생략"
          },
          "task": {
            "type": "array",
            "title": "Task",
            "items": {
              "type": "string"
            },
            "description": "조사하기 원하는 값으로 이루어진 리스트로 예를 들면 'PER', '종가', '외국인합계', '개인' 이와 같이 표기될 수 있고 '종가', '거래량', '개인', '기관합계', '기타법인', '외국인합계' 이 안에 있는 값들만 들어갈 수 있다."
          }
        }
      },
      "FundamentalItem": {
        "properties": {
          "question": {
            "type": "string",
            "title": "Question",
            "description": "사용자가 gpt에 질문한 문장을 그대로 전달"
          },
          "date": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Date",
            "description": "알고싶은 연도의 list를 작성한다. 예를 들면 ['2020','2021','2022']와 같이 필요한 연도를 list에 넣는다."
          },
          "stock_code": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Stock Code",
            "description": "조사하기 원하는 주식의 종목코드로 이루어진 리스트로 예를 들면 ['035420', '005930'] 이와 같이 들어올 수 있음. 종목코드는 숫자 6자리로만 이루어져 있어야 하고 뒤에 :KRX는 생략"
          },
          "task": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Task",
            "description": "적합한 항목을 넣어서 list로 만들어줘. 예를 들면 ['매출액','영업이익(발표기준)','당기순이익']"
          }
        },
        "type": "object",
        "required": [
          "question",
          "date",
          "stock_code",
          "task"
        ],
        "title": "FundamentalItem"
      },
      "ValidationError": {
        "type": "object",
        "title": "ValidationError",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "properties": {
          "loc": {
            "type": "array",
            "title": "Location",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            }
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        }
      }
    }
  }
}