Skip to main content

API Documentation Template

Use this template when documenting REST API endpoints manually (for endpoints not auto-generated by OpenAPI/Swagger).


Endpoint Name

Brief one-sentence description of what this endpoint does.

HTTP Request

METHOD /api/v1/resource/{parameter}

Description

Detailed description of the endpoint's functionality, use cases, and behavior.

Authentication

Required authentication method:

  • Type: JWT Bearer Token
  • Scope: read:stocks (or applicable scope)

Path Parameters

ParameterTypeRequiredDescription
parameterstringYesDescription of the parameter

Query Parameters

ParameterTypeRequiredDefaultDescription
limitintegerNo20Number of results (max: 100)
offsetintegerNo0Pagination offset
sort_bystringNocreated_atField to sort by

Request Headers

HeaderRequiredDescription
AuthorizationYesJWT Bearer token
Content-TypeYesapplication/json

Request Body

info

Include this section only for POST, PUT, PATCH requests

{
"field1": "value1",
"field2": 123,
"nested": {
"field3": true
}
}

Schema:

FieldTypeRequiredDescription
field1stringYesDescription of field1
field2integerNoDescription of field2
nested.field3booleanNoDescription of nested field

Response

Success Response (200 OK):

{
"status": "success",
"data": {
"id": "12345",
"name": "Example Resource",
"created_at": "2025-11-13T10:30:00Z"
},
"metadata": {
"total": 100,
"limit": 20,
"offset": 0
}
}

Response Schema:

FieldTypeDescription
statusstringResponse status ("success" or "error")
dataobjectResponse payload
data.idstringUnique identifier
data.namestringResource name
data.created_atstringISO 8601 timestamp
metadataobjectPagination metadata

Error Responses

400 Bad Request:

{
"status": "error",
"error": {
"code": "INVALID_PARAMETER",
"message": "The 'limit' parameter must be between 1 and 100",
"field": "limit"
}
}

401 Unauthorized:

{
"status": "error",
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired authentication token"
}
}

404 Not Found:

{
"status": "error",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource with ID '12345' not found"
}
}

429 Too Many Requests:

{
"status": "error",
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Try again in 60 seconds",
"retry_after": 60
}
}

Common Error Codes:

CodeHTTP StatusDescription
INVALID_PARAMETER400Request parameter validation failed
UNAUTHORIZED401Missing or invalid authentication
FORBIDDEN403Insufficient permissions
RESOURCE_NOT_FOUND404Requested resource doesn't exist
RATE_LIMIT_EXCEEDED429Too many requests
INTERNAL_ERROR500Server error

Rate Limiting

  • Free Tier: 100 requests/hour
  • Pro Tier: 500 requests/hour
  • Enterprise: 2,000 requests/hour

Rate limit headers returned:

  • X-RateLimit-Limit: Maximum requests per hour
  • X-RateLimit-Remaining: Remaining requests
  • X-RateLimit-Reset: Unix timestamp when limit resets

Examples

cURL:

curl -X GET \
'https://api.screener.kr/api/v1/stocks?limit=10&sort_by=volume' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN' \
-H 'Content-Type: application/json'

Python:

import requests

url = "https://api.screener.kr/api/v1/stocks"
headers = {
"Authorization": "Bearer YOUR_JWT_TOKEN",
"Content-Type": "application/json"
}
params = {
"limit": 10,
"sort_by": "volume"
}

response = requests.get(url, headers=headers, params=params)
data = response.json()

print(f"Found {data['metadata']['total']} stocks")
for stock in data['data']:
print(f"- {stock['name']} ({stock['ticker']})")

TypeScript:

const response = await fetch(
'https://api.screener.kr/api/v1/stocks?limit=10&sort_by=volume',
{
method: 'GET',
headers: {
'Authorization': `Bearer ${jwtToken}`,
'Content-Type': 'application/json'
}
}
);

const data = await response.json();

console.log(`Found ${data.metadata.total} stocks`);
data.data.forEach((stock: Stock) => {
console.log(`- ${stock.name} (${stock.ticker})`);
});

Notes

Best Practices
  • Cache responses when possible to reduce API calls
  • Implement exponential backoff for rate limit errors
  • Always validate input parameters client-side before sending requests
warning
  • This endpoint returns cached data updated every 5 minutes
  • Large result sets (>1000 items) should use pagination
  • Historical data is retained for 5 years only

See Also


Last Updated: [Date] API Version: v1