API 엔드포인트
인증 (Authentication)
POST
/api/auth/login로그인 및 세션 토큰 발급POST
/api/auth/register신규 사용자 등록GET
/api/auth/tokenBearer JWT 토큰 발급POST
/api/api-keysAPI 키 생성 (설정 > API 키 관리)사이트 & 디바이스
GET
/api/sites사이트 목록 조회POST
/api/sites신규 사이트 등록GET
/api/devices디바이스 목록 조회POST
/api/devices디바이스 등록실시간 데이터
GET
/api/realtime실시간 전력 데이터 조회WS
wss://api.탄소이음.io/wsWebSocket 실시간 스트리밍AI 분석
POST
/api/ai/forecastAI 부하 예측 실행POST
/api/ai/anomaly이상 탐지 분석POST
/api/ai/optimize에너지 최적화 제안Webhooks
POST
/api/webhooksWebhook 등록GET
/api/webhooksWebhook 목록 조회예제 코드
요청
# 사이트 목록 조회 curl https://api.탄소이음.io/api/sites \ -H "Authorization: Bearer ea_live_YOUR_API_KEY" # 디바이스 목록 조회 curl https://api.탄소이음.io/api/devices \ -H "Authorization: Bearer ea_live_YOUR_API_KEY"
응답
{
"success": true,
"data": {
"apiKey": "ea_live_1234567890abcdef",
"name": "My API Key",
"scopes": ["read:sites", "write:devices"],
"createdAt": "2026-02-03T10:30:00Z",
"expiresAt": null
}
}SDK 라이브러리
Node.js
JavaScript/TypeScript SDK
npm install @탄소이음/sdk
import { 탄소이음 } from '@탄소이음/sdk';
const client = new 탄소이음({
apiKey: process.env.탄소이음_API_KEY
});
const sites = await client.sites.list();Python
Python SDK
pip install 탄소이음
from 탄소이음 import 탄소이음 client = 탄소이음(api_key="ea_live_...") sites = client.sites.list()
cURL
직접 HTTP 호출
별도 설치 불필요
curl https://api.탄소이음.io/api/sites \ -H "Authorization: Bearer ea_live_..."
API 사용 한도
| 요금제 | 일일 요청 수 | 분당 요청 수 |
|---|---|---|
| Free | 1,000 / 일 | 10 / 분 |
| Pro | 100,000 / 일 | 100 / 분 |
| Enterprise | 무제한 | 1,000 / 분 |