# endpoint.js > Turns GitHub REST API endpoints into generic request options [](https://www.npmjs.com/package/@octokit/endpoint) [](https://travis-ci.org/octokit/endpoint.js) [](https://greenkeeper.io/) `@octokit/endpoint` combines [GitHub REST API routes](https://developer.github.com/v3/) with your parameters and turns them into generic request options that can be used in any request library. - [Usage](#usage) - [API](#api) - [endpoint()](#endpoint) - [endpoint.defaults()](#endpointdefaults) - [endpoint.DEFAULTS](#endpointdefaults) - [endpoint.merge()](#endpointmerge) - [endpoint.parse()](#endpointparse) - [Special cases](#special-cases) - [The `data` parameter – set request body directly](#the-data-parameter-%E2%80%93-set-request-body-directly) - [Set parameters for both the URL/query and the request body](#set-parameters-for-both-the-urlquery-and-the-request-body) - [LICENSE](#license) ## Usage
| Browsers | Load @octokit/endpointdirectly from cdn.pika.dev
        
```html
``` | 
|---|---|
| Node | Install with npm install @octokit/endpoint```js
const { endpoint } = require("@octokit/endpoint");
// or: import { endpoint } from "@octokit/endpoint";
``` | 
| name | type | description | 
|---|---|---|
| route | String | If set, it has to be a string consisting of URL and the request method, e.g., GET /orgs/:org. If it’s set to a URL, only the method defaults toGET. | 
| options.method | String | Required unless routeis set. Any supported http verb. Defaults toGET. | 
| options.url | String | Required unless routeis set. A path or full URL which may contain:variableor{variable}placeholders,
        e.g.,/orgs/:org/repos. Theurlis parsed using url-template. | 
| options.baseUrl | String | Defaults to https://api.github.com. | 
| options.headers | Object | Custom headers. Passed headers are merged with defaults: headers['user-agent']defaults tooctokit-endpoint.js/1.2.3(where1.2.3is the released version).headers['accept']defaults toapplication/vnd.github.v3+json. | 
| options.mediaType.format | String | Media type param, such as raw,diff, ortext+json. See Media Types. Settingoptions.mediaType.formatwill amend theheaders.acceptvalue. | 
| options.mediaType.previews | Array of Strings | Name of previews, such as mercy,symmetra, orscarlet-witch. See API Previews. Ifoptions.mediaType.previewswas set as default, the new previews will be merged into the default ones. Settingoptions.mediaType.previewswill amend theheaders.acceptvalue.options.mediaType.previewswill be merged with an existing array set using.defaults(). | 
| options.data | Any | Set request body directly instead of setting it to JSON based on additional parameters. See "The dataparameter" below. | 
| options.request | Object | Pass custom meta information for the request. The requestobject will be returned as is. | 
| key | type | description | 
|---|---|---|
| method | String | The http method. Always lowercase. | 
| url | String | The url with placeholders replaced with passed parameters. | 
| headers | Object | All header names are lowercased. | 
| body | Any | The request body if one is present. Only for PATCH,POST,PUT,DELETErequests. | 
| request | Object | Request meta option, it will be returned as it was passed into endpoint() |