# 기본적인 데이터 조회 방법

DeepSearch API 는 방대한 이종 데이터의 조회, 연산을 지원하며, 이를 위하여 아래 3가지의 형태로 사용자는 데이터를 처리할 수 있습니다.

1. 쿼리를 통한 데이터 조회&#x20;
2. API 함수를 통한 데이터 조회
3. 조회된 데이터를 연산

모든 처리는 compute API 를 통하며, {입력} 부분에 쿼리 혹은 API 를 입력합니다.&#x20;

```
api.deepsearch.com/v1/compute?input={입력}

// 쿼리형태의 데이터조회 URL

https://api.deepsearch.com/v1/compute?input=삼성전자 매출액
https://api.deepsearch.com/v1/compute?input=삼성전자 매출액 2010-2020


// api형태의 데이터조회 URL

https://api.deepsearch.com/v1/compute?input=GetCompanyHistory(삼성전자)
https://api.deepsearch.com/v1/compute?input=GetCompanyHistory(KRX:005930,KRX:000020)
```

## 쿼리 형태의 데이터 조회&#x20;

간단한 쿼리 형태로 데이터를 조회 합니다.&#x20;

```
삼성전자 매출액
삼성전자 매출액 2018
삼성전자 매출액 2010-2018
삼성전자 주가
삼성전자 주가 2019-3-5
삼성전자 주가 2019-1-1-2019-12-31
```

쿼리는 자산이름, 속성(property), 기간으로 구성되며, 자산이름, 속성, 기간은 다수개 입력이 가능합니다.&#x20;

```
삼성전자 LG전자 주가 거래량 2019-3-5 2019-3-6
```

쿼리 입력의 예시는 아래와 같습니다.

```
api.deepsearch.com/v1/compute?input=삼성전자 LG전자 주가 거래량 2019-3-5 2019-3-6
```

쿼리 형태의 데이터 추출이 가능한 전체 속성 리스트는 다음의 페이지를 참조하십시오.

{% content-ref url="/pages/-M1ws5VV2nY4UYCqCkMu" %}
[쿼리를 통한 데이터 조회](/dp/api/inquiry.md)
{% endcontent-ref %}

## API 함수를 통한 데이터 조회&#x20;

entity - property - date range 형태로 조회가 용이하지 않은 데이터는 별도 API 함수를 생성하여 조회하고 있습니다. 기업분석 페이지의 컨센서스, 주주, 분야별 매출 등이 이에 해당합니다.

```
GetCompanyHistory(entities)
https://api.deepsearch.com/v1/compute?input=GetCompanyHistory(삼성전자)
https://api.deepsearch.com/v1/compute?input=GetCompanyHistory(KRX:005930,KRX:000020)
```

사용 가능한 전체 API 의 리스트는 다음의 페이지를 참조하십시오.

{% content-ref url="/pages/-M1wsL6uNRH8-zgor08k" %}
[API 함수를 통한 데이터 조회](/dp/api/func.md)
{% endcontent-ref %}

## 조회된 데이터를 연산

추출된 데이터는 4칙 연산 및 다양한 함수를 통하여 연산이 가능합니다.&#x20;

```
1+1
삼성전자 매출액 + LG전자 매출액
삼성전자 매출액 / 삼성전자 주가
삼성전자 주가 / LG전자 매출액 * 100

Max(삼성전자 매출액 2010-2018)
```

쿼리 입력의 예시는 아래와 같습니다.&#x20;

```
api.deepsearch.com/v1/compute?input=삼성전자 매출액 + LG전자 매출액
api.deepsearch.com/v1/compute?input=Max(삼성전자 매출액 2010-2018)
```

연산 가능한 함수 리스트는 다음의 페이지를 참조하십시오.&#x20;

{% content-ref url="/pages/-M1wsGhuKe3IUBLRvrnM" %}
[조회된 데이터를 연산](/dp/api/inquiry/compute.md)
{% endcontent-ref %}

## **결과 레이아웃**

쿼리의 결과는 json 으로 리턴되며, 상세 레이아웃은 아래와 같습니다.

{% content-ref url="/pages/-MW7Weuz\_Z408RVsFFv1" %}
[결과 레이아웃](/dp/api/result_layout.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.deepsearch.com/dp/api/query.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
