# 신호정보 (제공)

## 1. 신호정보 조회 API (GetSignalInfo)

### 요청 URL

```url
https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi
```

### 연계 주기&#x20;

요청 시, 실시간

### 프로토콜

HTTPS

### HTTP 메서드

GET

### 데이터 포맷

{% file src="/files/1kzzNEKN8ZzX4YoS4vIz" %}

### 참고사항

API를 요청할 때 다음 예와 같이 HTTP 요청 헤더에 접근 토큰(Access Token) 을 추가해야 합니다. <mark style="color:purple;">**접근 토큰 앞에 "Bearer " 문자열을 추가해야 한다는 점에 주의하세요.**</mark>

```
> GET /api/v1/rtsi/offer/gsi?csrdId=2330100700 HTTP/2
> Host: service.mqnicrnd5.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer <접근 토큰>
```

### 요청 예시

```bash
 curl --location 'https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi?csrdId=2330100700' \
--header 'Authorization: Bearer <접근 토큰>'
```

### 응답 예시

```json
{
    "results": [
        {
            "nodeId": "2330100700",
            "dttm": "20251104",
            "data": [
                {
                    "timestamp": "2025-11-04 09:05:07",
                    "phaseNo": 2,
                    "sigStatus": [
                        2
                    ],
                    "leftTime": [
                        4
                    ],
                    "pedestrian": null
                },
                {
                    "timestamp": "2025-11-04 09:11:47",
                    "phaseNo": 3,
                    "sigStatus": [
                        2
                    ],
                    "leftTime": [
                        4
                    ],
                    "pedestrian": [
                        {
                            "status": 6,
                            "left_time": 12,
                            "dir_cd": 70
                        }
                    ]
                }
            ]
        }
    ]
}
```

## 2. 신호정보 이력 리스트 조회 API (GetSignalHistFilePath)

일자별로 압축한 압축 파일의 URI 리스트를 반환합니다.

### 요청 URL

```url
https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshf
```

### 연계 주기&#x20;

요청 시, 1일

### 프로토콜

HTTPS

### HTTP 메서드

GET

### 데이터 포맷

{% file src="/files/7k6856rNXaAkmS9GPmOs" %}

### 참고사항

API를 요청할 때 다음 예와 같이 HTTP 요청 헤더에 접근 토큰(Access Token) 을 추가해야 합니다. <mark style="color:purple;">**접근 토큰 앞에 "Bearer " 문자열을 추가해야 한다는 점에 주의하세요.**</mark>

```
> GET /api/v1/rtsi/offer/gshf?csrdId=2330100700 HTTP/2
> Host: service.mqnicrnd5.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer <접근 토큰>
```

### 요청 예시

```bash
curl --location 'https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshf?csrdId=2330100700' \
--header 'Authorization: Bearer <접근 토큰>'
```

### 응답 예시

```json
{
    "results": [
        {
            "node_id": "2330100700",
            "uri": [
                {
                    "dttm": "20240613",
                    "filePath": "rtsi/2330100700/20240613/2330100700_rtsi_20240613.zip",
                },
                {
                    "dttm": "20240614",
                    "filePath": "rtsi/2330100700/20240614/2330100700_rtsi_20240614.zip",
                },
            ]
        },
    ]
}
```

## 3. 신호정보 이력 압축파일 제공 API (GetSignalHistData)

### 요청 URL

```url
https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshd
```

### 연계 주기&#x20;

요청 시&#x20;

### 프로토콜

HTTPS

### HTTP 메서드

GET

### 데이터 포맷

{% file src="/files/VOkVQQFEsDXjppAgr6b8" %}

### 참고사항

API를 요청할 때 다음 예와 같이 HTTP 요청 헤더에 접근 토큰(Access Token) 을 추가해야 합니다. <mark style="color:purple;">**접근 토큰 앞에 "Bearer " 문자열을 추가해야 한다는 점에 주의하세요.**</mark>

```
> GET /api/v1/rtsi/offer/gshd?filePath=rtsi/1570193000/20240613/1570193000_rtsi_20240613.zip HTTP/2
> Host: service.mqnicrnd5.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer <접근 토큰>
```

### 요청 예시

```bash
curl --location 'https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshd?filePath=rtsi/1570193000/20240613/1570193000_rtsi_20240613.zip' \
--header 'Authorization: Bearer <접근 토큰>'
```

### 응답 예시

<mark style="color:red;">추후 샘플 파일 업로드 예정입니다.</mark>

## 4. 차량 관점 실시간 신호 정보 조회 API (GetCarViewSignalInfo)

### 요청 URL

```url
https://service.mqnicrnd5.com/api/v1/rtsi/offer/gcvsi
```

### 연계 주기&#x20;

요청 시, 실시간

### 프로토콜

HTTPS

### HTTP 메서드

GET

### 데이터 포맷

{% file src="/files/eBcNqumbJAldgMHmwXea" %}

### 참고사항

API를 요청할 때 다음 예와 같이 HTTP 요청 헤더에 접근 토큰(Access Token) 을 추가해야 합니다. <mark style="color:purple;">**접근 토큰 앞에 "Bearer " 문자열을 추가해야 한다는 점에 주의하세요.**</mark>

```
> GET /api/v1/rtsi/offer/gcvsi?entryLinkId=2333915902,2333916400,2333916202&csrdId=2330383800 HTTP/2
> Host: service.mqnicrnd5.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer <접근 토큰>
```

### 요청 예시

```bash
 curl --location 'https://service.mqnicrnd5.com/rtsi/offer/gcvsi?entryLinkId=2333915902,2333916400,2333916202&csrdId=2330383800' \
--header 'Authorization: Bearer <접근 토큰>'
```

### 응답 예시

```json
{
    "signalCarView": [
        {
            "timestamp": "2026-01-14 18:31:34.000",
            "csrdId": "2330383800",
            "entryLinkId": "2333915902",
            "phaseNo": null,
            "sigInfo": 2,
            "status": 5,
            "leftTime": 255
        },
        {
            "timestamp": "2026-01-14 18:31:34.000",
            "csrdId": "2330383800",
            "entryLinkId": "2333916400",
            "phaseNo": null,
            "sigInfo": 2,
            "status": 5,
            "leftTime": 255
        },
        {
            "timestamp": "2026-01-14 18:31:34.000",
            "csrdId": "2330383800",
            "entryLinkId": "2333916202",
            "phaseNo": null,
            "sigInfo": 2,
            "status": 4,
            "leftTime": 255
        }
    ]
}
```

## 5. 신호정보 제공 API 구현 예제

다음은 각 언어별 실시간 신호정보 제공 API 구현 예제입니다.

### 신호정보 조회 API (GetSignalInfo)

{% tabs %}
{% tab title="Java" %}

```java

import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import java.net.URL;

public class CallAPI {

    public static void main(String[] args) {
        String accessToken = "Bearer " + "<접근 토큰>";
        
        String csrdId = "1570062500,1570069937";
        Boolean pSignal = false;
                
        String apiURL = "https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi?"
                + "csrdId=" + csrdId + "&"
                + "pSignal=" + pSignal;

        Map<String, String> requestHeaders = new HashMap<>();
        requestHeaders.put("Authorization", accessToken);
        String responseBody = get(apiURL,requestHeaders);

        System.out.println(responseBody);
    }


    private static String get(String apiUrl, Map<String, String> requestHeaders) {
        HttpURLConnection con = connect(apiUrl);
        try {
            con.setRequestMethod("GET");
            for (Map.Entry<String, String> header : requestHeaders.entrySet()) {
                con.setRequestProperty(header.getKey(), header.getValue());
            }

            int responseCode = con.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) { // 정상 호출
                return readBody(con.getInputStream());
            } else { // 오류 발생
                return readBody(con.getErrorStream());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            con.disconnect();
        }
    }


    private static HttpURLConnection connect(String apiUrl) {
        try {
            URL url = new URL(apiUrl);
            return (HttpURLConnection) url.openConnection();
        } catch (MalformedURLException e) {
            throw new RuntimeException("API URL이 잘못되었습니다. : " + apiUrl, e);
        } catch (IOException e) {
            throw new RuntimeException("연결이 실패했습니다. : " + apiUrl, e);
        }
    }


    private static String readBody(InputStream body) {
        InputStreamReader streamReader = new InputStreamReader(body);


        try (BufferedReader lineReader = new BufferedReader(streamReader)) {
            StringBuilder responseBody = new StringBuilder();


            String line;
            while ((line = lineReader.readLine()) != null) {
                responseBody.append(line);
            }


            return responseBody.toString();
        } catch (IOException e) {
            throw new RuntimeException("API 응답을 읽는 데 실패했습니다.", e);
        }
    }

}

```

{% endtab %}

{% tab title="Python" %}

```python

import requests
import json

def send_get_request():

    accessToken = "Bearer " + "<접근 토큰>"

    csrdId = "1570062500,1570069937"
    pSignal = false
        
    apiURL = "https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi?" \
        + "csrdId=" + str(csrdId) + "&" \
        + "pSignal=" + str(pSignal)
   
    headers = {
        "Authorization": accessToken
    }
    
    response = requests.get(apiURL, headers=headers)
    
    print("GET Request:")
    print("Response Code:", response.status_code)
    print("Response:", response.text)

if __name__ == "__main__":
    send_get_request()


```

{% endtab %}

{% tab title="Node.js" %}

```javascript

const https = require('https');

function main() {
    const accessToken = "Bearer <접근 토큰>";
  
    const csrdId = "1570062500,1570069937";
    const pSignal = false;
    
    const apiURL = `https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi?csrdId=${csrdId}&pSignal=${pSignal}`;

    const headers = {
        'Authorization': accessToken
    };

    get(apiURL, headers)
        .then(responseBody => {
            console.log(responseBody);
        })
        .catch(error => {
            console.error('Error:', error);
        });
}

function get(apiURL, headers) {
    return new Promise((resolve, reject) => {
        const options = {
            headers: headers
        };

        https.get(apiURL, options, response => {
            let data = '';
            response.on('data', chunk => {
                data += chunk;
            });

            response.on('end', () => {
                resolve(data);
            });
        }).on('error', error => {
            reject(error);
        });
    });
}

main();

```

{% endtab %}

{% tab title="C#" %}

```csharp

using System;
using System.IO;
using System.Net;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        string accessToken = "Bearer <접근 토큰>";
        
        string csrdId = "1570062500,1570069937";
        bool pSignal = false;
        
        string apiURL = $"https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi?csrdId={csrdId}&pSignal={pSignal}";

        string responseBody = Get(apiURL, accessToken);

        Console.WriteLine(responseBody);
    }

    static string Get(string apiUrl, string accessToken)
    {
        try
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiUrl);
            request.Method = "GET";
            request.Headers["Authorization"] = accessToken;

            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            using (Stream stream = response.GetResponseStream())
            using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
            {
                return reader.ReadToEnd();
            }
        }
        catch (WebException e)
        {
            using (WebResponse response = e.Response)
            using (Stream dataStream = response.GetResponseStream())
            using (StreamReader reader = new StreamReader(dataStream))
            {
                string errorResponse = reader.ReadToEnd();
                throw new Exception($"Error occurred: {errorResponse}", e);
            }
        }
    }
}

```

{% endtab %}
{% endtabs %}

### 신호정보 이력 리스트 조회 API (GetSignalHistFilePath)

{% tabs %}
{% tab title="Java" %}

```java

import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import java.net.URL;

public class CallAPI {

    public static void main(String[] args) {
        String accessToken = "Bearer " + "<접근 토큰>";
        
        String csrdId = "1570062500,1570069937";
        String stDttm = "202304011";
        String edDttm = "202304012";
                
        String apiURL = "https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshf?"
                + "csrdId=" + csrdId + "&"
                + "stDttm=" + stDttm + "&"
                + "edDttm=" + edDttm;

        Map<String, String> requestHeaders = new HashMap<>();
        requestHeaders.put("Authorization", accessToken);
        String responseBody = get(apiURL,requestHeaders);

        System.out.println(responseBody);
    }


    private static String get(String apiUrl, Map<String, String> requestHeaders) {
        HttpURLConnection con = connect(apiUrl);
        try {
            con.setRequestMethod("GET");
            for (Map.Entry<String, String> header : requestHeaders.entrySet()) {
                con.setRequestProperty(header.getKey(), header.getValue());
            }

            int responseCode = con.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) { // 정상 호출
                return readBody(con.getInputStream());
            } else { // 오류 발생
                return readBody(con.getErrorStream());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            con.disconnect();
        }
    }


    private static HttpURLConnection connect(String apiUrl) {
        try {
            URL url = new URL(apiUrl);
            return (HttpURLConnection) url.openConnection();
        } catch (MalformedURLException e) {
            throw new RuntimeException("API URL이 잘못되었습니다. : " + apiUrl, e);
        } catch (IOException e) {
            throw new RuntimeException("연결이 실패했습니다. : " + apiUrl, e);
        }
    }


    private static String readBody(InputStream body) {
        InputStreamReader streamReader = new InputStreamReader(body);


        try (BufferedReader lineReader = new BufferedReader(streamReader)) {
            StringBuilder responseBody = new StringBuilder();


            String line;
            while ((line = lineReader.readLine()) != null) {
                responseBody.append(line);
            }


            return responseBody.toString();
        } catch (IOException e) {
            throw new RuntimeException("API 응답을 읽는 데 실패했습니다.", e);
        }
    }

}

```

{% endtab %}

{% tab title="Python" %}

```python

import requests
import json

def send_get_request():

    accessToken = "Bearer " + "<접근 토큰>"

    csrdId = "1570062500,1570069937"
    stDttm = "202304011"
    edDttm = "202304012"
        
    apiURL = "https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshf?" \
        + "csrdId=" + str(csrdId) + "&" \
        + "stDttm=" + str(stDttm) + "&" \
        + "edDttm=" + str(edDttm) 
   
    headers = {
        "Authorization": accessToken
    }
    
    response = requests.get(apiURL, headers=headers)
    
    print("GET Request:")
    print("Response Code:", response.status_code)
    print("Response:", response.text)

if __name__ == "__main__":
    send_get_request()


```

{% endtab %}

{% tab title="Node.js" %}

```javascript

const https = require('https');

function main() {
    const accessToken = "Bearer <접근 토큰>";
  
    const csrdId = "1570062500,1570069937";
    const stDttm = "202304011";
    const edDttm = "202304012";
    
    const apiURL = `https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshf?csrdId=${csrdId}&stDttm=${edDttm}&stDttm=${edDttm}`;

    const headers = {
        'Authorization': accessToken
    };

    get(apiURL, headers)
        .then(responseBody => {
            console.log(responseBody);
        })
        .catch(error => {
            console.error('Error:', error);
        });
}

function get(apiURL, headers) {
    return new Promise((resolve, reject) => {
        const options = {
            headers: headers
        };

        https.get(apiURL, options, response => {
            let data = '';
            response.on('data', chunk => {
                data += chunk;
            });

            response.on('end', () => {
                resolve(data);
            });
        }).on('error', error => {
            reject(error);
        });
    });
}

main();

```

{% endtab %}

{% tab title="C#" %}

```csharp

using System;
using System.IO;
using System.Net;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        string accessToken = "Bearer <접근 토큰>";
        
        string csrdId = "1570062500,1570069937";
        string stDttm = "202304011";
        string edDttm = "202304012";
        
        string apiURL = $"https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshf?csrdId={csrdId}&stDttm={stDttm}&edDttm={edDttm}";

        string responseBody = Get(apiURL, accessToken);

        Console.WriteLine(responseBody);
    }

    static string Get(string apiUrl, string accessToken)
    {
        try
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiUrl);
            request.Method = "GET";
            request.Headers["Authorization"] = accessToken;

            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            using (Stream stream = response.GetResponseStream())
            using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
            {
                return reader.ReadToEnd();
            }
        }
        catch (WebException e)
        {
            using (WebResponse response = e.Response)
            using (Stream dataStream = response.GetResponseStream())
            using (StreamReader reader = new StreamReader(dataStream))
            {
                string errorResponse = reader.ReadToEnd();
                throw new Exception($"Error occurred: {errorResponse}", e);
            }
        }
    }
}

```

{% endtab %}
{% endtabs %}

### 신호정보 이력 압축파일 제공 API (GetSignalHistData)&#x20;

{% tabs %}
{% tab title="Java" %}

```java

import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import java.net.URL;

public class CallAPI {

    public static void main(String[] args) {
        String accessToken = "Bearer " + "<접근 토큰>";

        String filePath = "rtsi/1570193000/20240613/1570193000_rtsi_20240613.zip";

        String apiURL = "https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshd?"
                + "filePath=" + filePath;

        Map<String, String> requestHeaders = new HashMap<>();
        requestHeaders.put("Authorization", accessToken);
        String responseBody = get(apiURL,requestHeaders);

        System.out.println(responseBody);
    }


    private static String get(String apiUrl, Map<String, String> requestHeaders) {
        HttpURLConnection con = connect(apiUrl);
        try {
            con.setRequestMethod("GET");
            for (Map.Entry<String, String> header : requestHeaders.entrySet()) {
                con.setRequestProperty(header.getKey(), header.getValue());
            }

            int responseCode = con.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) { // 정상 호출
                return readBody(con.getInputStream());
            } else { // 오류 발생
                return readBody(con.getErrorStream());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            con.disconnect();
        }
    }


    private static HttpURLConnection connect(String apiUrl) {
        try {
            URL url = new URL(apiUrl);
            return (HttpURLConnection) url.openConnection();
        } catch (MalformedURLException e) {
            throw new RuntimeException("API URL이 잘못되었습니다. : " + apiUrl, e);
        } catch (IOException e) {
            throw new RuntimeException("연결이 실패했습니다. : " + apiUrl, e);
        }
    }


    private static String readBody(InputStream body) {
        InputStreamReader streamReader = new InputStreamReader(body);


        try (BufferedReader lineReader = new BufferedReader(streamReader)) {
            StringBuilder responseBody = new StringBuilder();


            String line;
            while ((line = lineReader.readLine()) != null) {
                responseBody.append(line);
            }


            return responseBody.toString();
        } catch (IOException e) {
            throw new RuntimeException("API 응답을 읽는 데 실패했습니다.", e);
        }
    }

}

```

{% endtab %}

{% tab title="Python" %}

<pre class="language-python"><code class="lang-python">
import requests
import json

def send_get_request():

    accessToken = "Bearer " + "&#x3C;접근 토큰>"
    
<strong>    filePath = "rtsi/1570193000/20240613/1570193000_rtsi_20240613.zip"
</strong><strong>    
</strong>    apiURL = "https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshd?" \
        + "filePath=" + str(filePath)
   
    headers = {
        "Authorization": accessToken
    }
    
    response = requests.get(apiURL, headers=headers)
    
    print("GET Request:")
    print("Response Code:", response.status_code)
    print("Response:", response.text)

if __name__ == "__main__":
    send_get_request()


</code></pre>

{% endtab %}

{% tab title="Node.js" %}

```javascript

const https = require('https');

function main() {
    const accessToken = "Bearer <접근 토큰>";

    const filePath = "rtsi/1570193000/20240613/1570193000_rtsi_20240613.zip";
    
    const apiURL = `https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshd?filePath=${filePath}`;

    const headers = {
        'Authorization': accessToken
    };

    get(apiURL, headers)
        .then(responseBody => {
            console.log(responseBody);
        })
        .catch(error => {
            console.error('Error:', error);
        });
}

function get(apiURL, headers) {
    return new Promise((resolve, reject) => {
        const options = {
            headers: headers
        };

        https.get(apiURL, options, response => {
            let data = '';
            response.on('data', chunk => {
                data += chunk;
            });

            response.on('end', () => {
                resolve(data);
            });
        }).on('error', error => {
            reject(error);
        });
    });
}

main();

```

{% endtab %}

{% tab title="C#" %}

```csharp

using System;
using System.IO;
using System.Net;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        string accessToken = "Bearer <접근 토큰>";

        string filePath = "rtsi/1570193000/20240613/1570193000_rtsi_20240613.zip";

        string apiURL = $"https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshd?filePath={filePath}";

        string responseBody = Get(apiURL, accessToken);

        Console.WriteLine(responseBody);
    }

    static string Get(string apiUrl, string accessToken)
    {
        try
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiUrl);
            request.Method = "GET";
            request.Headers["Authorization"] = accessToken;

            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            using (Stream stream = response.GetResponseStream())
            using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
            {
                return reader.ReadToEnd();
            }
        }
        catch (WebException e)
        {
            using (WebResponse response = e.Response)
            using (Stream dataStream = response.GetResponseStream())
            using (StreamReader reader = new StreamReader(dataStream))
            {
                string errorResponse = reader.ReadToEnd();
                throw new Exception($"Error occurred: {errorResponse}", e);
            }
        }
    }
}

```

{% endtab %}
{% endtabs %}


---

# 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://docs.mqnicrnd5.com/guide/rest-api/signal-rsti-offer.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.
