> For the complete documentation index, see [llms.txt](https://falcon-bot.gitbook.io/falcon-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://falcon-bot.gitbook.io/falcon-api/reference/best-practices.md).

# Best Practices

## Performance

Follow these guidelines to improve query performance and reduce unnecessary load.

* **Cache responses when appropriate** to avoid repeated API requests.
* **Use pagination for large datasets** to prevent large responses.\
  Recommended limit: `≤ 100`.
* **Implement exponential backoff for retries** to handle temporary failures.
* **Monitor rate limits** to avoid excessive requests.

***

## Security

Follow standard API security practices when using Falcon in production.

* Store API tokens in **environment variables**
* Never commit tokens to **version control**
* **Rotate tokens periodically**
* Use **separate tokens for development and production environments**

***

## Error Handling

Applications should handle common API response codes gracefully.

| Code | Meaning      | Action                       |
| ---- | ------------ | ---------------------------- |
| 200  | Success      | Process returned data        |
| 400  | Bad Request  | Check request format         |
| 401  | Unauthorized | Verify API token             |
| 429  | Rate Limit   | Implement retry with backoff |
| 500  | Server Error | Retry request with backoff   |

{% hint style="info" %}
**💡 Notes**

* `429` indicates rate limiting, use exponential backoff before retrying
* `500` errors may be temporary, retries are recommended
* Always validate request structure before sending
  {% endhint %}
