---
title: Récupérer les dépendances d'un service APM
description: Récupérez les services situés directement en amont et en aval d'un service spécifique.
breadcrumbs: Documentation > API > Récupérer les dépendances d'un service APM
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# Récupérer les dépendances d'un service APM

## v1 (latest)

{% alert level="warning" %}
**Note: This endpoint is in public beta. If you have any feedback,
contact [Datadog support](https://docs.datadoghq.com/help.md).**
{% /alert %}

| Datadog site      | API endpoint                                                            |
| ----------------- | ----------------------------------------------------------------------- |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v1/service_dependencies/{service}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v1/service_dependencies/{service} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v1/service_dependencies/{service} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v1/service_dependencies/{service}      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v1/service_dependencies/{service} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v1/service_dependencies/{service} |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v1/service_dependencies/{service} |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v1/service_dependencies/{service}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v1/service_dependencies/{service}  |

### Overview

Récupérez les services situés directement en amont et en aval d'un service spécifique. Les services récupérés sont filtrés en fonction de leur environnement et d'un tag primaire, si un tel tag est défini.

### Arguments

#### Path Parameters

| Field                | Type   | Description                                      |
| -------------------- | ------ | ------------------------------------------------ |
| service [*required*] | string | The name of the service go get dependencies for. |

#### Query Strings

| Field            | Type    | Description                                                                                                 |
| ---------------- | ------- | ----------------------------------------------------------------------------------------------------------- |
| env [*required*] | string  | Specify what APM environment to query service dependencies by.                                              |
| primary_tag      | string  | Specify what primary tag to query service dependencies by.                                                  |
| start            | integer | Specify the start of the timeframe in epoch seconds to query for. (defaults to 1 hour before end parameter) |
| end              | integer | Specify the end of the timeframe in epoch seconds to query for. (defaults to current time)                  |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
An object with information on APM services that call, and are called by a given service.

| Field     | Type     | Description                                        |
| --------- | -------- | -------------------------------------------------- |
| called_by | [string] | List of service names that call the given service. |
| calls     | [string] | List of service names called by the given service. |
| name      | string   | Name of the APM service being searched for.        |
{% /tab %}

{% tab label="Example" %}
```json
{
  "called_by": [
    "service-a",
    "service-b"
  ],
  "calls": [
    "service-d",
    "service-e"
  ],
  "name": "service-c"
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
Error response object.

| Field               | Type     | Description                          |
| ------------------- | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Authentication Error

{% tabs %}
{% tab label="Model" %}
Error response object.

| Field               | Type     | Description                          |
| ------------------- | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
Error response object.

| Field               | Type     | Description                          |
| ------------------- | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export service="service-c"
# Required query arguments
export env="prod"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/service_dependencies/${service}?env=${env}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
