# 予測サーバーIDの取得

> 予測サーバーIDの取得 - REST APIからcURLコマンドを使用するか、DataRobot Pythonクライアントを使用して、予測サーバーIDを取得する方法を学びます。

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-07-23T18:01:59.432066+00:00` (UTC).

## Primary page

- [予測サーバーIDの取得](https://docs.datarobot.com/ja/docs/api/reference/predapi/pred-server-id.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [ドキュメンテーション](https://docs.datarobot.com/ja/docs/api/reference/predapi/pred-server-id.html.md#documentation): In-page section heading.

## Documentation content

DataRobotの [予測API](https://docs.datarobot.com/ja/docs/api/reference/predapi/legacy-predapi/dr-predapi.html.md) を使ってデプロイから予測を行うには、予測サーバーIDが必要です。 このチュートリアルでは、REST APIからcURLコマンドを使用するか、DataRobot Pythonクライアントを使用してIDを取得する方法を学習します。 取得した予測サーバーIDを使用してモデルをデプロイし、予測を行うことができます。

> [!NOTE] 備考
> 先に進む前に、このチュートリアルにはAPIキーが必要であることに注意してください。 詳細については、 [APIキーの作成](https://docs.datarobot.com/ja/docs/platform/acct-settings/api-key-mgmt.html.md) チュートリアルを参照してください。

**cURL:**
```
curl -v \
-H "Authorization: Bearer API_KEY" \ YOUR_DR_URL/api/v2/predictionServers/

Example
API_KEY=YOUR_API_KEY
ENDPOINT=YOUR_DR_URL/api/v2/predictionServers/

curl -v \
-H "Authorization: Bearer $API_KEY" \
$ENDPOINT 
```

**Python:**
Pythonで進める前に、 [開発者クイックスタート](https://docs.datarobot.com/ja/docs/api/dev-learning/api-quickstart.html.md) で説明されているとおりに、DataRobot Pythonクライアントをインストールし、DataRobotへの接続を設定していることを確認します。

```
# Set up your environment
import os
import datarobot as dr

API_KEY = os.environ["API_KEY"]
YOUR_DR_URL = os.environ["YOUR_DR_URL"]
FILE_PATH = os.environ["FILE_PATH"]
ENDPOINT = YOUR_DR_URL+"/api/v2"

# Instantiate DataRobot instance
dr.Client(
    token=API_KEY,
    endpoint=ENDPOINT
)

prediction_server_id = dr.PredictionServer.list()[0].id
print(prediction_server_id) 
```


## ドキュメンテーション

このチュートリアルで説明されている機能については、以下のドキュメントも参照できます。

- APIキー管理
- DataRobot開発者ポータル 。
- DataRobot予測API
