# Safary API

Welcome to the first public release of Safary API. This REST API allows you to access diverse resources from <https://api.safary.club/v1/docs>. With a range of methods and endpoints at your disposal, you can manipulate and retrieve useful data with ease. It should be noted, however, that this is a beta release. As we continue to develop and refine our API, changes may occur, so your patience and understanding are most appreciated.

***

## Table of Contents&#x20;

1. [API Specification](#api-specification)
2. [OpenAPI Specification](#openapi-specification)
3. [LLM Optimized Documentation](#llm-optimized-documentation)

***

## API Specification

{% hint style="info" %}
API Specification is available at <https://api.safary.club/v1/docs>
{% endhint %}

The interactive API documentation provides a user-friendly and machine-readable interface to explore all available endpoints, test API calls directly from your browser, and view request/response examples. This documentation is automatically generated from the OpenAPI specification and includes:

* Interactive endpoint explorer
* Try-it-out functionality to test API calls
* Request/response schema documentation
* Authentication examples
* All available endpoints organized by resource typ

## OpenAPI Specification

{% hint style="info" %}
OpenAPI Specification is available at [https://api.safary.club/v1/openapi](https://api.safary.club/v1/docs)
{% endhint %}

The OpenAPI 3.1 specification endpoint provides the complete API schema in JSON format. This is useful for:

* Generating API client libraries
* Importing into API testing tools (Postman, Insomnia, etc.)
* Automated API documentation generation
* Integration with development tools

## LLM-Optimized Documentation

{% hint style="info" %}
OpenAPI Specification is available at [https://api.safary.club/v1/llms.txt](https://api.safary.club/v1/docs)
{% endhint %}

The [llms.txt](https://llmstxt.org/) endpoint provides a markdown-formatted version of the API documentation optimized for Large Language Models (LLMs) and AI assistants. This format is designed to be easily consumed by AI tools for code generation and API integration assistance.

### Versioning

Our API uses a versioning system to ensure its evolutivity. Each version is pathed; for example, the current version is `v1`. Hence, all methods are found behind the main URL as follows: `https://api.safary.club/v1/{method-name}`. This structure allows us to evolve the API while maintaining backwards compatibility.

### Authentication

Authentication to our API is performed using API keys. To create your keys, you must first log in to your Safary account. Then, navigate to your settings and find the subheading labeled 'API keys'.

Include your API key in your API calls using the `Authorization: Bearer {Your API key}` HTTP header. Here is an example using `curl`:

```sh
curl -X GET 'https://api.safary.club/v1/{method-name}' \
-H 'Authorization: Bearer {your-api-key}'
```

Note: Replace the `{method-name}` placeholder with the actual method name (eg: `websites`, `wallets`) you want to access and replace `{your-api-key}` with your actual API key.

### Pagination

All list endpoints in our API are paginated. List endpoints accept two pagination parameters: `page` and `limit`. Currently, the API can return a maximum of 100 elements at a time. However, this could change as we continue to develop and enhance the API.

### OData Query Filtering

Many endpoints support OData query strings via the `q` parameter for advanced filtering. For detailed information about available endpoints and filtering options, refer to the interactive API documentation at <https://api.safary.club/v1/docs>

### Rate Limiting

Rate limiting information will be available in a future update.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://safary-1.gitbook.io/safary-doc-2.0/build/safary-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
