신호정보 (제공)
신호정보 및 일자 별 이력을 제공합니다.
Last updated
신호정보 및 일자 별 이력을 제공합니다.
Last updated
https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi
요청 시
HTTPS
GET
API를 요청할 때 다음 예와 같이 HTTP 요청 헤더에 접근 토큰(Access Token) 을 추가해야 합니다. 접근 토큰 앞에 "Bearer " 문자열을 추가해야 한다는 점에 주의하세요.
> GET /api/v1/rtsi/offer/gsi?csrdId=1570063200 HTTP/2
> Host: service.mqnicrnd5.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer <접근 토큰>
curl --location 'https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi?csrdId=1570063200' \
--header 'Authorization: Bearer <접근 토큰>'
{
"results": [
{
"nodeId": "1570192600",
"dttm": "20240617",
"data": [
{
"timestamp": "2024-06-17 10:52:33",
"phaseNo": 3,
"sigStatus": [
2
],
"leftTime": [
4
],
"pedestrian": []
},
{
"timestamp": "2024-06-17 10:52:37",
"phaseNo": 4,
"sigStatus": [
3
],
"leftTime": [
25
],
"pedestrian": []
}
]
}
]
}
일자별로 압축한 압축 파일의 URI 리스트를 반환합니다.
https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshf
요청 시
HTTPS
GET
API를 요청할 때 다음 예와 같이 HTTP 요청 헤더에 접근 토큰(Access Token) 을 추가해야 합니다. 접근 토큰 앞에 "Bearer " 문자열을 추가해야 한다는 점에 주의하세요.
> GET /api/v1/rtsi/offer/gshf?csrdId=1570063200 HTTP/2
> Host: service.mqnicrnd5.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer <접근 토큰>
curl --location 'https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshf?csrdId=1570195400' \
--header 'Authorization: Bearer <접근 토큰>'
{
"results": [
{
"node_id": "1570195400",
"uri": [
{
"dttm": "20240613",
"filePath": "rtsi/1570195400/20240613/1570195400_rtsi_20240613.zip",
},
{
"dttm": "20240614",
"filePath": "rtsi/1570195400/20240614/1570195400_rtsi_20240614.zip",
},
]
},
]
}
https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshd
요청 시
HTTPS
GET
API를 요청할 때 다음 예와 같이 HTTP 요청 헤더에 접근 토큰(Access Token) 을 추가해야 합니다. 접근 토큰 앞에 "Bearer " 문자열을 추가해야 한다는 점에 주의하세요.
> 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 <접근 토큰>
curl --location 'https://service.mqnicrnd5.com/api/v1/rtsi/offer/gshd?filePath=rtsi/1570193000/20240613/1570193000_rtsi_20240613.zip' \
--header 'Authorization: Bearer <접근 토큰>'
추후 샘플 파일 업로드 예정입니다.
다음은 각 언어별 실시간 신호정보 제공 API 구현 예제입니다.
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 stDttm = "202304011";
String edDttm = "202304012";
String apiURL = "https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi?"
+ "csrdId=" + csrdId + "&"
+ "pSignal=" + pSignal + "&"
+ "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);
}
}
}
import requests
import json
def send_get_request():
accessToken = "Bearer " + "<접근 토큰>"
csrdId = "1570062500,1570069937"
pSignal = false;
stDttm = "202304011"
edDttm = "202304012"
apiURL = "https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi?" \
+ "csrdId=" + str(csrdId) + "&" \
+ "pSignal=" + str(pSignal) + "&" \
+ "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()
const https = require('https');
function main() {
const accessToken = "Bearer <접근 토큰>";
const csrdId = "1570062500,1570069937";
const pSignal = false;
const stDttm = "202304011";
const edDttm = "202304012";
const apiURL = `https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi?csrdId=${csrdId}&pSignal=${pSignal}&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();
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 stDttm = "202304011";
string edDttm = "202304012";
string apiURL = $"https://service.mqnicrnd5.com/api/v1/rtsi/offer/gsi?csrdId={csrdId}&pSignal={pSignal}&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);
}
}
}
}
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);
}
}
}
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()
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();
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);
}
}
}
}
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);
}
}
}
import requests
import json
def send_get_request():
accessToken = "Bearer " + "<접근 토큰>"
filePath = "rtsi/1570193000/20240613/1570193000_rtsi_20240613.zip"
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()
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();
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);
}
}
}
}