RESTful API wrapper around the fx-sdk package.
Live API: https://fx-api-production.up.railway.app
- API Documentation: https://fx-api-production.up.railway.app/docs
- Health Check: https://fx-api-production.up.railway.app/v1/health
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env # Edit .env with your settings -
Run the API:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
-
Access the API:
- API: http://localhost:8000
- Docs: http://localhost:8000/docs
- Health: http://localhost:8000/v1/health
GET /v1/health- Health checkGET /v1/status- API status
GET /v1/balances/{address}- Get all balancesGET /v1/balances/{address}/fxusd- Get fxUSD balanceGET /v1/balances/{address}/fxn- Get FXN balance- More token endpoints coming...
GET /v1/protocol/nav- Get protocol NAV
- Free tier for all users:
- 100 requests/minute per IP
- 5,000 requests/hour per IP
- 50,000 requests/day per IP
- Swagger UI:
/docs - ReDoc:
/redoc - OpenAPI JSON:
/openapi.json
See .env.example for all available configuration options.
api/
├── app/
│ ├── main.py # FastAPI app
│ ├── config.py # Configuration
│ ├── dependencies.py # Dependency injection
│ ├── routes/ # API endpoints
│ ├── models/ # Pydantic models
│ ├── services/ # Business logic
│ └── middleware/ # Custom middleware
├── tests/ # Tests
├── requirements.txt # Dependencies
└── README.md # This file