Try the API Features
API landing page section: run a real-looking request: the response streams in and the message lands on a phone beside it.
Features
- One tab per feature, each with the same call in curl, JavaScript and Python
- Run streams the response in under the code, one line at a time
- When it finishes, the result lands on a phone beside the code with its delivery status
- Switching feature or language resets the run
- Keyboard reachable, 44px controls on touch screens, and the whole response at once for reduced motion
Best for: APIs and developer products that sell best when people see a call and its result side by side.
Installation
npm install motion lucide-react clsx tailwind-mergeThen copy the files from the Code tab into the same paths in your project, in TypeScript or JavaScript.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | ReactNode | - | The section's headline. |
| subtitle | ReactNode | - | One grey line under it. |
| samples | ApiSample[] | - | id, label, summary, code per language, response lines, message. |
| languages | string[] | - | The language names, in tab order; keys into each sample's code. |
| thread | { sender: string; earlier: string[] } | - | The phone's message thread. |
| className | string | - | Extra classes for the section. |
FAQ
Is the Try the API Features free to use?
Yes. Try the API Features is free to copy into your own projects. Open the Code tab and paste the files into your app.
Does Try the API Features work with Next.js and React?
Yes. It's a React client component made for the Next.js App Router, styled with Tailwind CSS and animated with Framer Motion (the motion package).
Can I use Try the API Features in JavaScript instead of TypeScript?
Yes. Every file comes in TypeScript and JavaScript. Switch the language in the Code tab.
What does Try the API Features need installed?
motion, lucide-react, clsx, tailwind-merge, plus the shared helpers from the Installation page.
Is Try the API Features accessible?
Every link and button is reachable by keyboard with a visible focus ring, and the animation stays still for visitors who ask for reduced motion.