프로필 목록 조회
curl --request GET \
--url https://sajuapi.dev/v1/profiles \
--header 'X-API-Key: <api-key>'import requests
url = "https://sajuapi.dev/v1/profiles"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://sajuapi.dev/v1/profiles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sajuapi.dev/v1/profiles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sajuapi.dev/v1/profiles"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sajuapi.dev/v1/profiles")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sajuapi.dev/v1/profiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body프로필
프로필 목록 조회
GET
/
v1
/
profiles
프로필 목록 조회
curl --request GET \
--url https://sajuapi.dev/v1/profiles \
--header 'X-API-Key: <api-key>'import requests
url = "https://sajuapi.dev/v1/profiles"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://sajuapi.dev/v1/profiles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sajuapi.dev/v1/profiles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sajuapi.dev/v1/profiles"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sajuapi.dev/v1/profiles")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sajuapi.dev/v1/profiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyv1 Enterprise API (Coming Soon)이 엔드포인트는 Enterprise 버전에서 제공될 예정입니다.
현재는 v0 API를 사용하세요.
Query 파라미터
integer
default:"20"
한 페이지에 반환할 프로필 수입니다. 1에서 100 사이의 값이어야 합니다.
string
다음 페이지를 조회하기 위한 커서입니다. 이전 응답의
next_cursor 값을 사용합니다.string
일주 오행으로 필터링합니다.
wood, fire, earth, metal, water 중 하나입니다.string
지정된 시간 이후에 생성된 프로필만 반환합니다. ISO 8601 형식입니다.
string
지정된 시간 이전에 생성된 프로필만 반환합니다. ISO 8601 형식입니다.
Response
성공
프로필 목록 조회에 성공하면 프로필 배열과 페이지네이션 정보가 반환됩니다.| 필드 | 타입 | 설명 |
|---|---|---|
data | array | Profile 객체 배열입니다. |
has_more | boolean | 다음 페이지가 있는지 여부입니다. |
next_cursor | string | 다음 페이지 조회를 위한 커서입니다. has_more가 true일 때만 반환됩니다. |
total_count | integer | 필터 조건에 맞는 전체 프로필 수입니다. |
실패
| 상태 코드 | 에러 타입 | 설명 |
|---|---|---|
| 400 | validation_error | 쿼리 파라미터가 유효하지 않음 |
| 401 | authentication_error | API 키가 유효하지 않음 |
| 429 | rate_limited | 요청 한도 초과 |
요청 예시
curl -X GET "https://api.sajuapi.dev/v1/profiles?limit=10&day_master_element=fire" \
-H "X-API-Key: bs_live_xxx"
const response = await fetch(
'https://api.sajuapi.dev/v1/profiles?limit=10&day_master_element=fire',
{
headers: {
'X-API-Key': 'bs_live_xxx'
}
}
);
const { data, has_more, next_cursor } = await response.json();
import requests
response = requests.get(
'https://api.sajuapi.dev/v1/profiles',
headers={'X-API-Key': 'bs_live_xxx'},
params={
'limit': 10,
'day_master_element': 'fire'
}
)
result = response.json()
profiles = result['data']
응답 예시
{
"data": [
{
"id": "prf_abc123def456",
"external_id": "user_12345",
"name": "김**",
"birth_year": "19**",
"gender": "male",
"day_master": "병화",
"day_master_element": "fire",
"weakest_element": "water",
"created_at": "2025-01-15T09:00:00Z",
"updated_at": "2025-01-15T09:00:00Z"
},
{
"id": "prf_def456ghi789",
"external_id": "user_67890",
"name": "이**",
"birth_year": "19**",
"gender": "female",
"day_master": "정화",
"day_master_element": "fire",
"weakest_element": "metal",
"created_at": "2025-01-14T15:30:00Z",
"updated_at": "2025-01-14T15:30:00Z"
}
],
"has_more": true,
"next_cursor": "eyJpZCI6InByZl9kZWY0NTZnaGk3ODkifQ==",
"total_count": 1523
}
페이지네이션
커서 기반 페이지네이션을 사용하여 대량의 프로필을 효율적으로 조회할 수 있습니다.async function getAllProfiles() {
let cursor = null;
const allProfiles = [];
do {
const url = new URL('https://api.sajuapi.dev/v1/profiles');
url.searchParams.set('limit', '100');
if (cursor) url.searchParams.set('cursor', cursor);
const response = await fetch(url, {
headers: { 'X-API-Key': 'bs_live_xxx' }
});
const { data, has_more, next_cursor } = await response.json();
allProfiles.push(...data);
cursor = has_more ? next_cursor : null;
} while (cursor);
return allProfiles;
}
⌘I