Answers.Body: <p>Have you tried passing is_distinct=1 as a parameter in api? It would show unique clicks and opens</p>
  <pre><code>$result = civicrm_api3('Mailing', 'stats', [
    'mailing_id' =&gt; 12,
    'is_distinct' =&gt; 1,
  ]);
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-30T13:48:40.973Z
Answers.Text: Thank you Pradeep
Answers.UserDisplayName: hazalciplak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-06T15:58:09.467Z
Answers.LastActivityDate: 2022-05-06T15:58:09.467Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I am getting summary report of email by using CiviCRM API but not able to get the field <code>Unique Opens</code> I can see on the report page.
  Currently I am using this query:</p>
  <pre><code>$result = civicrm_api3('Mailing', 'stats', [
    'mailing_id' =&gt; 10,
  ]);
  
  </code></pre>
  <p>And this gives me these columns:</p>
  <pre><code>{'Delivered': '1', 'Bounces': '0', 'Unsubscribers': 0, 'Unique Clicks': '0', 'Opened': '1', 'clickthrough_rate': '0%', 'opened_rate': '100%', 'delivered_rate': '100%'}
  </code></pre>
  <p>But not the <code>Unique Opens</code> which I need too.</p>
  <p>Example email report page:
  <a href="https://i.sstatic.net/31QjM.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/31QjM.png" alt="enter image description here" /></a></p>
  <p>Any help will be appreciated.</p>
  
Tags: <api><email>
Title: How to get Unique Opens with CiviCRM API?
ThreadText: # How to get Unique Opens with CiviCRM API?
  
  (Asked by: username_0 on 2022-05-06)
  
  I am getting summary report of email by using CiviCRM API but not able to get the field Unique Opens I can see on the report page.
  Currently I am using this query:
  $result = civicrm_api3('Mailing', 'stats', [
    'mailing_id' => 10,
  ]);
  
  
  And this gives me these columns:
  {'Delivered': '1', 'Bounces': '0', 'Unsubscribers': 0, 'Unique Clicks': '0', 'Opened': '1', 'clickthrough_rate': '0%', 'opened_rate': '100%', 'delivered_rate': '100%'}
  
  But not the Unique Opens which I need too.
  Example email report page:
  
  Any help will be appreciated.
  
  **Tags:** api, email
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-05-06. Score: 0 | Accepted answer
  
  Have you tried passing is_distinct=1 as a parameter in api? It would show unique clicks and opens
  $result = civicrm_api3('Mailing', 'stats', [
    'mailing_id' => 12,
    'is_distinct' => 1,
  ]);
  
  > **Comments:**
  > **username_0**: Thank you Pradeep  
  
  ---
  
  