무조건 유저가 자신 주식 포트폴리오 등록을 하면 요청 보내기
{
"stockType": "korea" or "us",
"stockName": 검색했을 때 주식이 나오는 stockName. 예를 들어 '엔비디아'가 아니라 'NVDA'
}
{
"reportType": "economy",
"stockName": "",
"riskTolerance": 위험 수용 성향 (1개),
"reportDifficultyLevel": 레포트 난이도 (1개),
"interestAreas": [관심 분야 (배열로 보내기)]
}
{
"reportType": "stock",
"stockName": 검색했을 때 주식이 나오는 stockName. 예를 들어 '엔비디아'가 아니라 'NVDA',
"riskTolerance": 위험 수용 성향 (1개),
"reportDifficultyLevel": 레포트 난이도 (1개),
"interestAreas": [관심 분야 (배열로 보내기)]
}
“Content-Type”: “application/json”
import requests, json
data = {
"reportType": "stock",
"stockName": "NVDA",
"riskTolerance": "하이리스크 하이리턴",
"reportDifficultyLevel": "전문가 수준의 레포트를 원합",
"interestAreas": ["주식시장", "국제 정세", "경제 지표", "기술 동향"],
}
headers = {
"Content-Type": "application/json"
}
response = requests.post("<https://dockerel.o-r.kr/api/v1/report>",
data=json.dumps(data),
headers=headers)
decoded = response.content.decode("utf-8")
data = json.loads(decoded)
print(f"summary : {data['data']['summary']}")
print(f"summary : {data['data']['insight']}")