Technical

API Examples: What 80% of Developers Read First

Developers copy-paste examples to start in minutes. Write examples they can use.

By Chandler Supple1 min read

API examples are the most valuable documentation. According to Nordic APIs, 80% of developers go straight to code examples before reading text. Well-crafted examples teach API usage faster than prose.

Request Example Checklist

ElementExample
HTTP methodPOST
Full URLhttps://api.example.com/v1/users
HeadersAuthorization: Bearer token
Body{"name": "Sarah Chen"}

Curl Template

curl -X POST https://api.example.com/v1/users \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Sarah Chen", "email": "sarah@example.com"}'

Error Responses to Include

StatusWhen
400Invalid data
401Invalid auth
404Not found
429Rate limit

Best Practices

  • Use realistic data (sarah@example.com not foo@bar)
  • Show complete requests with headers
  • Format JSON with indentation
  • Test every example
  • Use example.com, never production URLs

FAQ

How many languages?

Curl plus your users' languages. Add JavaScript, Python at minimum.

Can AI help?

Yes, River's API Example Generator creates complete request/response pairs.

Chandler Supple

Co-Founder & CTO at River

Chandler spent years building machine learning systems before realizing the tools he wanted as a writer didn't exist. He founded River to close that gap. In his free time, Chandler loves to read American literature, including Steinbeck and Faulkner.

Ready to write better, faster?

Try River's AI-powered document editor for free.

Get Started Free →