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

# Get ad analytics

> Retrieve LinkedIn Ads analytics data with configurable pivot and time grouping

Retrieve LinkedIn Ads analytics data with configurable pivot and time grouping

```http theme={null}
GET https://services.leadconnectorhq.com/ad-publishing/linkedin/reporting
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Query parameters

<ParamField query="locationId" type="string" required>
  Account ID
</ParamField>

<ParamField query="pivot" type="string">
  Analytics pivot type
</ParamField>

<ParamField query="groupBy" type="string">
  Time granularity for analytics
</ParamField>

<ParamField query="startDate" type="string" required default="2024-01-01">
  Start date in yyyy-mm-dd format
</ParamField>

<ParamField query="endDate" type="string" required default="2024-01-31">
  End date in yyyy-mm-dd format
</ParamField>

<ParamField query="entityUrns" type="string">
  Comma-separated list of entity URNs
</ParamField>

<ParamField query="fields" type="string[]">
  Comma-separated list of fields to retrieve
</ParamField>

## Respuestas

<Accordion title="200 - Response" />

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://services.leadconnectorhq.com/ad-publishing/linkedin/reporting' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/linkedin/reporting', {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
    },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'GET',
      'https://services.leadconnectorhq.com/ad-publishing/linkedin/reporting',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
      },
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/ad-publishing/linkedin/reporting');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'GET',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
      ],
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
