# Code groups

The same example in several languages, one tab each.

A code group puts several code blocks behind tabs with their titles. Readers pick their language once and copy what they need.

<CodeGroup>
```bash cURL
curl https://your-domain.example/api/v1/runs \
  -H "Authorization: Bearer $TOKEN"
```

```php PHP
$runs = Http::withToken($token)
    ->get('https://your-domain.example/api/v1/runs')
    ->json();
```

```javascript JavaScript
const response = await fetch('https://your-domain.example/api/v1/runs', {
  headers: { Authorization: `Bearer ${token}` },
});
const runs = await response.json();
```

```python Python
import requests

runs = requests.get(
    "https://your-domain.example/api/v1/runs",
    headers={"Authorization": f"Bearer {token}"},
).json()
```
</CodeGroup>

## Code group or tabs?

- **A code group** when every tab is code: the same call in different languages.
- **[Tabs](https://justdocs.qdev.tech/docs/writing/tabs)** when the options mix text, lists and code, such as setup steps per system.
