> For the complete documentation index, see [llms.txt](https://docs.antibot.to/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.antibot.to/reference/akamai/pixel.md).

# Pixel

## Generate pixel data

<mark style="color:green;">`POST`</mark> `https://api.antibot.to/akamai/pixel`

#### Headers

| Name                                           | Type   | Description                               |
| ---------------------------------------------- | ------ | ----------------------------------------- |
| content-type<mark style="color:red;">\*</mark> | String | application/json                          |
| apikey<mark style="color:red;">\*</mark>       | String | user-75188a82-fc45-4c4c-89a0-fa92ac65a8f4 |

#### Request Body

| Name                                        | Type   | Description                                                                                               |
| ------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| userAgent<mark style="color:red;">\*</mark> | String | **User Agent**                                                                                            |
| pixelId<mark style="color:red;">\*</mark>   | String | The Hash inside the **html body  (bazadebezolkohpepadr)**                                                 |
| scriptID<mark style="color:red;">\*</mark>  | String | <p>The Hash inside the <strong>pixel script</strong><br><strong>(Bottom of the pixel script)</strong></p> |

{% tabs %}
{% tab title="200: OK Successfully generated pixel data " %}

```javascript
{
    "pixelData": "pixel data...",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36"
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid Api Key" %}

```javascript
{
    "Success": false,
    "Error": "Invalid APIKey."
}
```

{% endtab %}
{% endtabs %}

### Code Example

#### Node JS

```javascript
var axios = require('axios');

var data = JSON.stringify({
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36",
  "pixelId": "135890212",
  "scriptID": "99d2984701765a5cb3a16a79dca64e00"
});

var config = {
  method: 'post',
  url: 'https://api.antibot.to/akamai/pixel',
  headers: { 
    'Content-Type': 'application/json'
    'apikey': 'user-75188a82-fc45-4c4c-89a0-fa92ac65a8f4', 
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

#### Python

```python
import requests
import json

url = "https://api.antibot.to/akamai/pixel"

payload = json.dumps({
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36",
  "pixelId": "135890212",
  "scriptID": "99d2984701765a5cb3a16a79dca64e00"
})
headers = {
  'Content-Type': 'application/json'
   'apikey': 'user-75188a82-fc45-4c4c-89a0-fa92ac65a8f4',
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

#### Golang

```go
package Pixel

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

type Payload struct {
    PixelId      string `json:"pixelId"`
    ScriptID       string `json:"scriptID"`
    UserAgent string `json:"userAgent"`
}

func main() {

    url := "https://api.antibot.to/akamai/pixel"
    method := "POST"

    payload := &Payload{
        pixelId:      "135890212",
        scriptID:      "99d2984701765a5cb3a16a79dca64e00",
        UserAgent:     "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36",
    }

    bodyBytes , err := json.Marshal(payload)
    if err != nil {
        // handle err
        fmt.Println(err)
        return
    }
    
    client := &http.Client{}
    req, err := http.NewRequest(method, url,bytes.NewReader(bodyBytes))

    if err != nil {
        // handle err
        fmt.Println(err)
        return
    }
    
    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("apikey", "user-75188a82-fc45-4c4c-89a0-fa92ac65a8f4")
   

    res, err := client.Do(req)
    if err != nil {
        // handle err
        fmt.Println(err)
        return
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(string(body))
}
```
