Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/api/README.md
1# Cloudflare API Integration23Guide for working with Cloudflare's REST API - authentication, SDK usage, common patterns, and troubleshooting.45## Quick Decision Tree67```8How are you calling the Cloudflare API?9├─ From Workers runtime → Use bindings, not REST API (see ../bindings/)10├─ Server-side (Node/Python/Go) → Official SDK (see api.md)11├─ CLI/scripts → Wrangler or curl (see configuration.md)12├─ Infrastructure-as-code → See ../pulumi/ or ../terraform/13└─ One-off requests → curl examples (see api.md)14```1516## SDK Selection1718| Language | Package | Best For | Default Retries |19|----------|---------|----------|-----------------|20| TypeScript | `cloudflare` | Node.js, Bun, Next.js, Workers | 2 |21| Python | `cloudflare` | FastAPI, Django, scripts | 2 |22| Go | `cloudflare-go/v4` | CLI tools, microservices | 10 |2324All SDKs are Stainless-generated from OpenAPI spec (consistent APIs).2526## Authentication Methods2728| Method | Security | Use Case | Scope |29|--------|----------|----------|-------|30| **API Token** ✓ | Scoped, rotatable | Production | Per-zone or account |31| API Key + Email | Full account access | Legacy only | Everything |32| User Service Key | Limited | Origin CA certs only | Origin CA |3334**Always use API tokens** for new projects.3536## Rate Limits3738| Limit | Value |39|-------|-------|40| Per user/token | 1200 requests / 5 minutes |41| Per IP | 200 requests / second |42| GraphQL | 320 / 5 minutes (cost-based) |4344## Reading Order4546| Task | Files to Read |47|------|---------------|48| Initialize SDK client | api.md |49| Configure auth/timeout/retry | configuration.md |50| Find usage patterns | patterns.md |51| Debug errors/rate limits | gotchas.md |52| Product-specific APIs | ../workers/, ../r2/, ../kv/, etc. |5354## In This Reference5556- **[api.md](api.md)** - SDK client initialization, pagination, error handling, examples57- **[configuration.md](configuration.md)** - Environment variables, SDK config, Wrangler setup58- **[patterns.md](patterns.md)** - Real-world patterns, batch operations, workflows59- **[gotchas.md](gotchas.md)** - Rate limits, SDK-specific issues, troubleshooting6061## See Also6263- [Cloudflare API Docs](https://developers.cloudflare.com/api/)64- [Bindings Reference](../bindings/) - Workers runtime bindings (preferred over REST API)65- [Wrangler Reference](../wrangler/) - CLI tool for Cloudflare development66- [GraphQL Analytics API Reference](../graphql-api/) - Analytics data via GraphQL (separate endpoint from REST API)67