> For the complete documentation index, see [llms.txt](https://peach-organization.gitbook.io/peach/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://peach-organization.gitbook.io/peach/api-reference/campaigns/get-campaign-stats.md).

# Get Campaign stats

The Campaign Stats endpoint provides detailed public statistics about a specific campaign, including the total amount raised, the number of donations, and aggregated statistics for different donation groups.

> **Note:**\
> **This endpoint is publicly accessible and does not require authentication.**
>
> The Campaign Stats endpoint is a public endpoint that can be accessed without an API key or any authentication mechanism. It is intended to expose **public campaign statistics** and may be called from any environment (server-side or client-side) to retrieve publicly available data for an organization’s campaign.
>
> No authorization headers are required when making requests to this endpoint.

**Campaign Stats Endpoint**

To retrieve campaign statistics, make a GET request to the following endpoint:

```bash
https://api.peach-in.com/v4/campaigns/stats/{accountId}/{campaignId}
```

* Replace `{accountId}` with the organization’s account ID
* Replace `{campaignId}` with the unique identifier of the campaign

**Response**

A successful response to the Campaign Stats endpoint will return the campaign statistics in the JSON format. The response will include the following information:

Here's an example response:

```json
{
    "campaignGoal": 5000,
    "totalSum": {
        "ILS": 20637.941389000003
    },
    "totalDonationCount": 275,
    "campaignGroups": {
        "hh9J1che": {
            "clicks": 0,
            "groupName": "test2",
            "createdAt": 1682246882662,
            "donationCount": 1,
            "linkId": "t2zahh9J1che",
            "managerId": "000",
            "groupGoal": "1000",
            "amountRaisedInILS": 5
        },
        "490g1che": 
            "clicks": 0,
            "lastName": "yyy",
            "groupName": "test",
            "createdAt": 1684356387968,
            "donationCount": 0,
            "linkId": "t2za490g1che",
            "managerId": "000",
            "groupGoal": "1234",
            "amountRaisedInILS": 0
        },
    }
}

```

**Example**

Here's an example cURL command to retrieve statistics for a specific campaign:

```bash
bashCopy codecurl -X GET \
  https://api.peach-in.com/v4/campaigns/stats/{accountID}/{campaignId}
```

Replace `{accountId}` with the Id of the account and  `{campaignId}` with the ID of the campaign you want to retrieve statistics for.
