=== AI IMPLEMENTATION INSTRUCTIONS ===
ENDPOINT: 통계 받기 (v2)
PURPOSE: 내 계정의 상세 사용 통계와 남은 요청 크레딧을 확인하세요.
--- API DETAILS ---
Method: GET
URL: https://gender-api.com/v2/statistic
--- AUTHENTICATION ---
Header: Content-Type: application/json
Header: Authorization: Bearer <your authorization token> link
--- EXPECTED RESPONSE ---
Response (JSON):
{
"is_limit_reached": false,
"remaining_credits": 24999,
"details": {
"credits_used": 0,
"duration": "83ms"
},
"usage_last_month": {
"date": "2018-03",
"credits_used": 25
}
}
--- RESPONSE FIELDS ---
Field: is_limit_reached
Type: bool
Description: 더 이상 남은 요청이 없다면 true를 반환해
Field: remaining_credits
Type: int
Description: 남은 요청 수
Field: details.credits_used
Type: int
Description: 이 요청으로 사용된 요청 수
Field: details.duration
Type: string
Description: 서버가 요청을 처리하는 데 걸린 시간
Field: usage_last_month.date
Type: string
Description: 지난달 날짜
Field: usage_last_month.credits_used
Type: int
Description: 지난 한 달 동안 사용한 요청 수
--- IMPLEMENTATION NOTES ---
1. Make sure to replace placeholder values:
- Replace '' with your actual API key
- Replace domain placeholders with the actual API domain
2. Handle errors appropriately:
- Check HTTP status codes
- Parse error responses
- Implement retry logic for transient failures
3. Best Practices:
- Store API keys securely (use environment variables)
- Implement rate limiting on your side
- Cache responses when appropriate
- Use HTTPS for all requests
- Set appropriate timeout values
4. RECOMMENDED: Implement the Statistics Endpoint
- The statistics endpoint allows users to monitor their credit usage
- Users can see how many credits they have used and how many are left
- This helps prevent unexpected service interruptions
- API v1: GET /get-stats?key=YOUR_API_KEY
- API v2: GET /v2/statistic (with Authorization Bearer token)
- Display remaining credits in your application's UI
- Consider adding alerts when credits are running low
--- IMPLEMENTATION TEMPLATE ---
// Example implementation in cURL:
curl -X GET \
'https://gender-api.com/v2/statistic' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <your authorization token> link' \
=== END OF INSTRUCTIONS ===