> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Proxy REST API

> Access the Bright Data proxy network via REST API POST /request (port 44445). Send target URLs and proxy parameters as JSON instead of routing through a port.

<Warning>
  You must have an API Key to access Bright Data proxy APIs. Get it here: [API Key tutorial](/api-reference/authentication#how-do-i-generate-a-new-api-key%3F)
</Warning>

**API Endpoint**: `POST` `/request`

**API URL:** `https://api.brightdata.com/request`

## Supported parameters

<ParamField path="zone" type="string" required="true">
  Name of the proxy zone which will service your request.
</ParamField>

<ParamField path="url" type="string" required="true">
  Target URL for your request.
</ParamField>

<ParamField path="method" type="string" default="GET">
  Method for requesting an HTML via proxy is `GET`.
</ParamField>

<ParamField path="format" type="string">
  Format for requesting a raw HTML via proxy is `raw`.

  Format for request a JSON response is `json`.
</ParamField>

<ParamField path="country" type="string">
  Country code of proxy which request is relayed thru.
</ParamField>

<ParamField path="city" type="string">
  City name of proxy which request is relayed thru, must have country defined.

  Supported in DC & ISP for zones preconfigured with cities, and in Residential and mobile networks by default.
</ParamField>

<ParamField path="zip" type="string">
  Zip code which request is relayed thru, must have country defined.

  Supported in Residential networks only.
</ParamField>

<ParamField path="ASN" type="string">
  ASN code which request is relayed thru, must have country defined.

  Supported in Residential networks only.
</ParamField>

<ParamField path="carrier" type="string">
  For mobile network only: carrier code in which request is relayed thru.

  Supported in mobile networks only.
</ParamField>

<ParamField path="os" type="string">
  Operating system of the client to set on proxy.

  Supported in mobile networks only.
</ParamField>

<ParamField path="dns" type="string">
  Use `local` or `remote` to set if domain name mapping is done locally on client side or on remote proxy peer.
</ParamField>

<ParamField path="session" type="string">
  A string relayed by the client to mark a session, all requests with the same session parameter will be relayed to the same proxy peer.
</ParamField>

<ParamField path="ip" type="string">
  In Datacenter and ISP zones: Relay the request to a specific proxy identified by the `ip`.
</ParamField>

<ParamField path="gip" type="string">
  In `Residential` and `Mobile` zones: Relay the request to a specific proxy group identified by the `gip`.
</ParamField>

<ParamField path="c_tag" type="string">
  Include a unique c\_tag flag in their requests. In response, businesses echo back the same tag in the header. This seamless exchange ensures that each response is bound to its corresponding request, eliminating confusion and streamlining data management.
</ParamField>

<ParamField path="direct" type="boolean">
  Setting the parameter to `true` will instruct to process the request by Bright Data super proxy, a datacenter located proxy and not the proxy peer itself.
</ParamField>

<ResponseExample>
  ```json RAW theme={null}
  {
    HTTP/1.1 200 OK
    Content-type: text/html
    Header_1: header_text

    HTML Body from target website.... 
  }
  ```

  ```json JSON theme={null}
  {
    HTTP/1.1 200 OK
    Content-type: text/json

    {
      "status_code": 200,
      "headers": {"header_1": "header_txt1", ...},
      "body": "target website text_or_utf8_bin_data"
    }
  }

  ```
</ResponseExample>

<RequestExample>
  ```sh Shell theme={null}
  curl -H "Authorization: Bearer [API KEY HERE]" -H "Content-Type: application/json" -d '{"zone": "Zone information","url": "https://geo.brdtest.com/welcome.txt", "format": "raw"}' https://api.brightdata.com/request
  ```
</RequestExample>
