| # API routes with REST | |
| Next.js ships with [API routes](https://github.com/vercel/next.js#api-routes), which provide an easy solution to build your own `API`. This example shows how it can be used to create your [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) `API`. | |
| ## Deploy your own | |
| [](https://vercel.com/new/clone?repository-url=https://github.com/vercel/next.js/tree/canary/examples/api-routes-rest&project-name=api-routes-rest&repository-name=api-routes-rest) | |
| ## How to use | |
| Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example: | |
| ```bash | |
| npx create-next-app --example api-routes-rest api-routes-rest-app | |
| ``` | |
| ```bash | |
| yarn create next-app --example api-routes-rest api-routes-rest-app | |
| ``` | |
| ```bash | |
| pnpm create next-app --example api-routes-rest api-routes-rest-app | |
| ``` | |
| ### Deploy to Vercel | |
| Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). | |