> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://mailchimp.com/developer/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mailchimp.com/developer/_mcp/server.

# Send your first API request

> Make your first call to the Marketing API and verify your credentials with the Ping endpoint.

## Install a client library

You can call the Marketing API with whatever you normally use to make HTTP
requests, but a [client library](/marketing/build/start-developing/client-libraries-and-sdks)
handles authentication and response parsing for you. Install the one for your
language:

**`cURL`**

```bash title="cURL"
# No client installation necessary; just using curl
```

**`TypeScript`**

```typescript title="TypeScript"
npm install @mailchimp/mailchimp-marketing
```

**`Python`**

```python title="Python"
pip install mailchimp-marketing
```

**`Go`**

```go title="Go"
go get github.com/mailchimp/mailchimp-marketing-go-sdk
```

**`Java`**

```java title="Java"
// Gradle
implementation("com.mailchimp:mailchimp-marketing:LATEST_VERSION")
```

**`C#`**

```csharp title="C#"
dotnet add package Mailchimp.Marketing
```

**`PHP`**

```php title="PHP"
composer require mailchimp/marketing-sdk
```

**`Ruby`**

```ruby title="Ruby"
gem install mailchimp-marketing
```

**`Swift`**

```swift title="Swift"
// Swift Package Manager — add to Package.swift dependencies:
.package(url: "https://github.com/mailchimp/mailchimp-marketing-swift-sdk", from: "1.0.0")
```

**`Rust`**

```rust title="Rust"
cargo add mailchimp_marketing
```

## Make your first API call

To test that you have everything set up correctly, we’ll make a simple request to the Ping endpoint. Hitting this endpoint acts as a health check on the Mailchimp API service; it won’t affect your account in any way.

**`cURL`**

```bash title="cURL"
# install jq: https://stedolan.github.io/jq/download/

apikey="YOUR_API_KEY"

curl -sS \
  "https://api.mailchimp.com/3.0/ping" \
  --user "anystring:${apikey}" | jq -r
```

**`TypeScript`**

```typescript title="TypeScript"
import { MailchimpClient } from "@mailchimp/mailchimp-marketing";

const client = new MailchimpClient({
  token: "YOUR_API_KEY",
});

const response = await client.ping.list();
console.log(response);
```

**`Python`**

```python title="Python"
from mailchimp_marketing import MailchimpClient

client = MailchimpClient(
    token="YOUR_API_KEY",
)

response = client.ping.list()
print(response)
```

**`Go`**

```go title="Go"
import (
	"context"
	"fmt"

	mailchimp "github.com/mailchimp/mailchimp-marketing-go-sdk/client"
	"github.com/mailchimp/mailchimp-marketing-go-sdk/option"
)

client := mailchimp.NewMailchimpClient(
	option.WithToken("YOUR_API_KEY"),
)

response, err := client.Ping.List(context.Background())
fmt.Println(response)
```

**`Java`**

```java title="Java"
import com.mailchimp.marketing.MailchimpClient;

MailchimpClient client = MailchimpClient.builder()
    .token("YOUR_API_KEY")
    .build();

var response = client.ping().list();
System.out.println(response);
```

**`C#`**

```csharp title="C#"
using Mailchimp.Marketing;

var client = new MailchimpClient("YOUR_API_KEY");

var response = await client.Ping.ListAsync();
Console.WriteLine(response);
```

**`PHP`**

```php title="PHP"
require_once('/path/to/vendor/autoload.php');

use Mailchimp\MailchimpClient;

$client = new MailchimpClient('YOUR_API_KEY');

$response = $client->ping->list();
print_r($response);
```

**`Ruby`**

```ruby title="Ruby"
require "mailchimp"

client = Mailchimp::Client.new(token: "YOUR_API_KEY")

response = client.ping.list
puts response
```

**`Swift`**

```swift title="Swift"
import Mailchimp

let client = MailchimpClient(token: "YOUR_API_KEY")

let response = try await client.ping.list()
print(response)
```

**`Rust`**

```rust title="Rust"
use mailchimp_marketing::prelude::*;

let config = ClientConfig {
    token: Some("YOUR_API_KEY".to_string()),
    ..Default::default()
};
let client = MailchimpClient::new(config).expect("Failed to build client");

let response = client.ping.list(None).await;
println!("{:?}", response);
```

If everything was set up correctly and the request to `ping` was a success, the response should look like the following:

```json
{
   "health_status": "Everything's Chimpy!"
}
```

## Next steps

Now that you’re successfully making authenticated requests to the API with your API key and client library of choice, you’re ready to dive into the Mailchimp Marketing API.

The first thing you may want to do is learn how to [import and export contacts](/marketing/build/quickstarts/import-and-export-contacts) between your application and a Mailchimp audience. You may also want to familiarize yourself with the [Marketing API docs](/marketing/api-concepts/api-structure), which outline some of the common conventions you’ll run into across the API, or browse the extensive [API Reference documentation](/marketing/api).