> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrape.st/llms.txt
> Use this file to discover all available pages before exploring further.

# Best Practices

> Guidelines for secure and efficient Scrapest API usage

Follow these practices for reliable, secure integrations.

## Rate Limits

* **Handle 429 responses**: Implement retry with exponential backoff
* **Monitor usage**: Check your dashboard for rate limit status
* **Retry example**:

```javascript theme={null}
async function request(url) {
  for (let i = 0; i < 3; i++) {
    try {
      return await fetch(url);
    } catch (e) {
      if (e.status !== 429) throw e;
      await new Promise((r) => setTimeout(r, 1000 * 2 ** i));
    }
  }
}
```

## Security

* **Never hardcode keys** — use `process.env.SCRAPEST_API_KEY`
* **Add to .gitignore** — never commit keys
* **Use HTTPS** — always secure connections

## Quick Checklist

* [ ] API key in environment variables
* [ ] Retry logic implemented
* [ ] HTTPS for all endpoints
* [ ] Error handling in place
