Docs
Utils API

Utils API

The Utils API provides utility endpoints for monitoring API health, retrieving usage statistics, and submitting feedback.

Available Endpoints

MethodEndpointDescription
GET/v1/usageRetrieve basic usage information
GET/v1/healthCheck API health status
POST/v1/feedbackSubmit user feedback

Get Usage Information

Retrieves basic usage statistics for your API key.

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.tatry.dev/v1/usage
from tatry import TatryRetriever
 
# Initialize the client with your API key
client = TatryRetriever(api_key="your-api-key")
 
# Get usage statistics
usage = client.get_usage()

Query Parameters

ParameterTypeDescription
monthstringOptional. The month for which to retrieve usage (YYYY-MM format)

Response

{
	"status": "success",
	"data": {
		"time_range": {
			"month": "2024-02"
		},
		"usage": {
			"queries": {
				"total": 1000,
				"by_source": {
					"wikipedia": 500,
					"academic_journals": 500
				}
			},
			"documents": {
				"total": 5000,
				"by_source": {
					"wikipedia": 2500,
					"academic_journals": 2500
				}
			}
		}
	}
}

Check API Health

Returns the current health status of the API.

curl https://api.tatry.dev/v1/health
from tatry import TatryRetriever
 
# Initialize the client with your API key
client = TatryRetriever(api_key="your-api-key")
 
# Check API health
health = client.check_health()

Response

{
	"status": "success",
	"data": {
		"status": "healthy",
		"version": "1.0.0",
		"timestamp": "2024-02-12T12:00:00Z"
	}
}

Submit Feedback

Allows users to submit feedback about the API.

curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "bug", "description": "Issue with search results"}' \
  https://api.tatry.dev/v1/feedback
from tatry import TatryRetriever
 
# Initialize the client with your API key
client = TatryRetriever(api_key="your-api-key")
 
# Submit feedback
feedback = client.submit_feedback(
    type="bug",
    description="Issue with search results"
)

Request Body

FieldTypeDescription
typestringType of feedback (bug/feature/other)
descriptionstringDetailed feedback description
metadataobjectOptional. Additional context about the feedback

Response

{
	"status": "success",
	"data": {
		"id": "fb_123456",
		"received_at": "2024-02-12T12:00:00Z",
		"message": "Thank you for your feedback"
	}
}

Error Responses

rate_limit_exceeded (429)

Too many requests in a given time period.

{
	"status": "error",
	"error": {
		"code": "rate_limit_exceeded",
		"message": "Rate limit exceeded",
		"details": {
			"retry_after": 60
		}
	}
}

Next Steps