# Developers

The Frankencoin API provides comprehensive access to all data within the Frankencoin ecosystem. This RESTful API enables developers to integrate Frankencoin functionality into their applications, build analytics tools, monitor positions, and interact with the protocol programmatically.

## Base URL

```
https://api.frankencoin.com
```

## API Features

The Frankencoin API is organized into several controllers, each serving specific data about different aspects of the ecosystem:

### Core Controllers

* [**Ecosystem**](/api-docs/ecosystem.md) - Get information about the Frankencoin token, FPS, minters, and collateral
* [**Positions**](/api-docs/positions.md) - Manage and query collateralized lending positions
* [**Challenges**](/api-docs/challenges.md) - Access liquidation challenge and auction data
* [**Prices**](/api-docs/prices.md) - Access price feeds and historical price data for collateral assets
* [**Savings**](/api-docs/savings.md) - Query savings module data, interest rates, and yields
* [**Transfers**](/api-docs/transfers.md) - Track ZCHF transfers with custom reference messages
* [**Analytics**](/api-docs/analytics.md) - Retrieve ecosystem-wide metrics and financial analytics

## Response Format

In general API responses are returned in JSON format. Most list endpoints follow a consistent structure:

```json
{
  "num": 100,
  "list": [...]
}
```

or

```json
{
  "num": 100,
  "addresses": [...],
  "map": {...}
}
```

## Data Precision

Financial amounts in the API are typically represented as strings to preserve precision:

* Token amounts are in **wei** (1e18 precision for 18-decimal tokens)
* Timestamps are **Unix epoch** (seconds)
* Interest rates are in **PPM** (parts per million, e.g., 20000 = 2%)

## Interactive Documentation

For interactive API exploration with request/response examples, visit the Swagger documentation:

```
https://api.frankencoin.com
```

## Rate Limiting

The API currently has no rate limiting, but please use reasonable request rates to ensure fair access for all users.

## Support

For API questions or issues:

* GitHub Smart Contracts: [Frankencoin ZCHF](https://github.com/Frankencoin-ZCHF/FrankenCoin)
* GitHub API NestJS: [Frankencoin API](https://github.com/Frankencoin-ZCHF/frankencoin-api)
* NPM Package for ABIs, Addresses, SupportedChains, ...: [NPM Package Core](https://www.npmjs.com/package/@frankencoin/zchf)
* NPM Package for API Types, Return Types, ...: [NPM Package API Types](https://www.npmjs.com/package/@frankencoin/api)
* Swagger Docs: [api.frankencoin.com](https://api.frankencoin.com)


---

# 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://docs.frankencoin.com/api-docs.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.
