# FlashData Google Places API

現地企業や場所を探す 利用可能な場合、名前、住所、座標、評価、連絡先の詳細を取得します。

キャニシニカル参照: https://flashdata.dev/ja/docs/sources/google_places
レビュー: 2026-10-23

エンドポイント: POST https://data.flashdata.dev/v1/queries/realtime
認証: X-API-Key: YOUR_API_KEY
モード: [Realtime](https://flashdata.dev/ja/docs/reference/realtime-and-async/reference.md#realtime) · [Async](https://flashdata.dev/ja/docs/reference/realtime-and-async/reference.md#async) · [Batch](https://flashdata.dev/ja/docs/reference/batch-and-bulk/reference.md#batch)

必要なソース権限: google_places

YOUR_API_KEYをAPIキーに置き換え、このソースの許可と利用可能なクレジットを持っています。 サーバやエージェントホストのリクエストを実行します。

[認証の設定](https://flashdata.dev/ja/docs/guides/headers-and-authentication/reference.md)

[Google検索を選択および精製](https://flashdata.dev/ja/docs/guides/google-search-guide/reference.md)

<a id="quickstart"></a>

## リクエストを送信

### Python

```bash
python3 -m pip install requests
```

```python
import json

import requests

api_key = "YOUR_API_KEY"
payload = {
    "source": "google_places",
    "query": "coffee in san francisco",
    "params": {
        "gl": "us",
        "hl": "en",
        "num": 10,
        "page": 1,
    },
}

response = requests.post(
    "https://data.flashdata.dev/v1/queries/realtime",
    headers={"X-API-Key": api_key},
    json=payload,
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), ensure_ascii=False, indent=2))
```

### Bash / cURL

```bash
api_key="YOUR_API_KEY"
curl --fail-with-body --max-time 120 --request POST "https://data.flashdata.dev/v1/queries/realtime" \
  --header "Content-Type: application/json" \
  --header "X-API-Key: $api_key" \
  --data-binary @- <<'FLASHDATA_JSON'
{
  "source": "google_places",
  "query": "coffee in san francisco",
  "params": {
    "gl": "us",
    "hl": "en",
    "num": 10,
    "page": 1
  }
}
FLASHDATA_JSON
```

<a id="parameters"></a>

## パラメーター

<a id="parameters-group-0"></a>

### リクエストボディ

| パラメータ | 種類 | 必須 | 既定値 | 説明: |
| --- | --- | --- | --- | --- |
| <a id="parameter-source"></a> source | string | はい はい | — | google_placesに設定します。  |
| <a id="parameter-query"></a> query | string | はい はい | 設定なし | クエリを検索します。 Googleの検索演算子をサイト: と intitle などのサポートします。 最少の長さ: 1。 最高長さ: 2000。 |
| <a id="parameter-params"></a> params | object | ノーザン | {} | この要求のためのSettings。  |
| <a id="parameter-callback_url"></a> callback_url | string · nullable | ノーザン | 設定なし | Asyncとバッチだけ。 パブリック HTTPS エントリーフォーム URL 港に 443まで、 2,048 文字。 ユーザーの資格情報や URL フラグメントはありません。 Omit は、通知なしの null または空の文字列を使用します。 バッチでは、各クエリで、外部のパラメータで設定します。  |

<a id="parameters-group-1"></a>

### 国、言語、場所

| パラメータ | 種類 | 必須 | 既定値 | 説明: |
| --- | --- | --- | --- | --- |
| <a id="parameter-params-gl"></a> params.gl | string | ノーザン | 設定なし | 私たち、gb、de、sg などの2文字の国コード。 国を選択するために明示的に設定します。 最少の長さ: 2。 最高長さ: 2。 パターン:^[A-Za-z]{2}$ |
| <a id="parameter-params-hl"></a> params.hl | string | ノーザン | 設定なし | Googleインターフェイス言語。 言語を選択するために明示的に設定します。 最少の長さ: 1。 最高長さ: 35。 パターン:^[A-Za-z0-9-]+$ |
| <a id="parameter-params-location"></a> params.location | string | ノーザン | 設定なし | "London, England, United Kingdom"のような都市、好ましく検索場所を要求しました。 空室状況は検索タイプによって異なります。 最少の長さ: 1。 最高長さ: 200。 |

<a id="parameters-group-2"></a>

### パジネーション

| パラメータ | 種類 | 必須 | 既定値 | 説明: |
| --- | --- | --- | --- | --- |
| <a id="parameter-params-num"></a> params.num | integer | ノーザン | 設定なし | リクエストされた結果のカウント。 FlashData は省略時に固定されたデフォルトは追加しません。 返されたカウントはクエリと検索タイプによって異なる場合があります。 最小: 1。 最高: 100。 |
| <a id="parameter-params-page"></a> params.page | integer | ノーザン | 設定なし | リクエスト結果ページ。 明示的に設定します。 各ページは別々のAPIリクエストです。 最小: 1。 最高: 100。 |

<a id="parameters-group-3"></a>

### フィルターを検索

| パラメータ | 種類 | 必須 | 既定値 | 説明: |
| --- | --- | --- | --- | --- |
| <a id="parameter-params-tbs"></a> params.tbs | string | ノーザン | 設定なし | qdr:d などの Google の検索フィルタを、過去の曜日または qdr:w の qdr:d などのリクエストした。 空室状況は検索タイプによって異なります。 最少の長さ: 1。 最高長さ: 200。 |
| <a id="parameter-params-autocorrect"></a> params.autocorrect | boolean | ノーザン | 設定なし | true でスペル補正をリクエストするか、false で無効にリクエストしてください。 応用動作は検索タイプによって異なります。 Googleの動作を使用する省略。  |

<a id="response"></a>

## 結果を読む

response.jsonとして成功するJSON応答を保存します。 これをread-response.pyとして保存し、python read-response.pyを実行します。 Pythonの標準ライブラリのみを使用し、新しいリクエストは使用しません。

### read-response.py

```python
import json
from pathlib import Path

response = json.loads(Path("response.json").read_text(encoding="utf-8-sig"))
if response.get("status") not in ("done", "completed") or not isinstance(response.get("results"), list):
    raise SystemExit("Expected completed result JSON; inspect the response or job status.")
if not response["results"]:
    print("[]")
    raise SystemExit(0)
result = response["results"][0]

output = [
    {name: item.get(name) for name in ("title", "address", "latitude", "longitude", "website")}
    for item in result.get("places", [])
]
print(json.dumps(output, ensure_ascii=False, indent=2))
```

## レスポンスの例

記録された例; フィールドとカウントは、ソースと要求された入力に依存します。
```json
{
  "source": "google_places",
  "status": "done",
  "results": [
    {
      "searchParameters": {
        "q": "coffee in san francisco",
        "gl": "us",
        "hl": "en",
        "type": "places",
        "num": 10,
        "page": 1,
        "engine": "google"
      },
      "places": [
        {
          "position": 1,
          "title": "Kopê House",
          "address": "546 Laguna St",
          "latitude": 37.776222,
          "longitude": -122.42606,
          "rating": 4.9,
          "ratingCount": 76,
          "priceLevel": "$1–10",
          "category": "Cafe",
          "cid": "7430826673754830499"
        },
        {
          "position": 2,
          "title": "The Coffee Berry SF",
          "address": "1410 Lombard St",
          "latitude": 37.80141,
          "longitude": -122.424995,
          "rating": 4.9,
          "ratingCount": 642,
          "priceLevel": "$1–10",
          "category": "Coffee shop",
          "cid": "5181132708478222499"
        },
        {
          "position": 3,
          "title": "Sightglass Coffee",
          "address": "270 7th St",
          "latitude": 37.77704,
          "longitude": -122.40844,
          "rating": 4.4,
          "ratingCount": 3400,
          "priceLevel": "$10–20",
          "category": "Coffee shop",
          "cid": "13926460886861596347"
        },
        {
          "position": 4,
          "title": "Origin Lab Coffee & Matcha",
          "address": "211 Sutter St",
          "latitude": 37.789722,
          "longitude": -122.404175,
          "rating": 4.7,
          "ratingCount": 624,
          "priceLevel": "$1–10",
          "category": "Coffee shop",
          "cid": "9114931074474087601"
        },
        {
          "position": 5,
          "title": "The Coffee Movement",
          "address": "1737 Balboa St",
          "latitude": 37.7765,
          "longitude": -122.477806,
          "rating": 4.8,
          "ratingCount": 623,
          "priceLevel": "$1–10",
          "category": "Coffee shop",
          "cid": "2726196137705445702"
        },
        {
          "position": 6,
          "title": "Third Wheel Coffee",
          "address": "991 Oak St",
          "latitude": 37.77323,
          "longitude": -122.43559,
          "rating": 4.9,
          "ratingCount": 266,
          "priceLevel": "$1–10",
          "category": "Coffee shop",
          "cid": "1837357391573517555"
        },
        {
          "position": 7,
          "title": "Better Half Coffee",
          "address": "1448 Pacific Ave",
          "latitude": 37.79555,
          "longitude": -122.41909,
          "rating": 4.9,
          "ratingCount": 123,
          "priceLevel": "$10–20",
          "category": "Coffee shop",
          "cid": "11196405476986641272"
        },
        {
          "position": 8,
          "title": "Sextant Coffee Roasters",
          "address": "1415 Folsom St",
          "latitude": 37.772472,
          "longitude": -122.412964,
          "rating": 4.4,
          "ratingCount": 746,
          "priceLevel": "$1–10",
          "category": "Coffee shop",
          "cid": "16500984014294458956"
        },
        {
          "position": 9,
          "title": "Doppio Coffee & Brunch",
          "address": "1551 Mission St",
          "latitude": 37.773315,
          "longitude": -122.418015,
          "rating": 4.8,
          "ratingCount": 494,
          "priceLevel": "$10–20",
          "category": "Coffee shop",
          "cid": "16475263059648961979"
        },
        {
          "position": 10,
          "title": "Delah Coffee",
          "address": "370 4th St",
          "latitude": 37.781017,
          "longitude": -122.40022,
          "rating": 4.6,
          "ratingCount": 1200,
          "priceLevel": "$10–20",
          "category": "Coffee shop",
          "cid": "10682847123881919373"
        }
      ]
    }
  ],
  "usage": {
    "credits": 0.02
  },
  "created_at": "2026-09-16T07:41:45.679Z"
}
```

## 応答分野

| フィールド | 種類 | 説明: |
| --- | --- | --- |
| source | string | 要求されたAPIの源。 |
| status | string | リアルタイムリクエストが成功したときに行われる。 |
| created_at | string | ISO 8601 形式の応答作成時間。 |
| usage.credits | number | リクエストに応じて請求されるクレジットは、プランに基づいて行われます。 |
| results[0].searchParameters | object | Googleで報告された検索設定は、クエリがqとして記録されています。 返された設定は、要求された値と異なる場合があります。 |
| results[0].places | array | ローカル検索結果。 |
| results[0].places[].title | string | 氏名、商号 |
| results[0].places[].address | string · optional | ストリートアドレス。 |
| results[0].places[].latitude | number · optional | 緯度.. |
| results[0].places[].longitude | number · optional | 経度。 |
| results[0].places[].rating | number · optional | 平均評価。 |
| results[0].places[].ratingCount | integer · optional | 評価件数。 |
| results[0].places[].category | string · optional | 営業品目 |
| results[0].places[].phoneNumber | string · optional | リストされた電話番号。 |
| results[0].places[].website | string · optional | 営業サイト |
| results[0].places[].cid | string · optional | Googleの場所の識別子。 |
| results[0].places[].position | integer | 結果の位置。 |
| results[0].places[].priceLevel | string · optional | 利用できる場合の表示された価格のレベル。 |

- 利用可能なフィールドは、クエリと検索タイプによって異なります。 オプションのフィールドは不在であり、追加のフィールドが返される場合があります。
- params.num は返された項目の数と searchParameters.num と異なることができます。 返された配列を使用して、実際の結果のカウントを決定します。

## レスポンス形式

応答はデフォルトでJSONを使用します。 これらのオプションヘッダーで別の形式を選択します。

- Accept: application/json (デフォルト) または text/plain. プレーンテキストは、読みやすいレイアウトで同じフィールドを提示します。
- X-Respond-With: markdown. 元のフィールドにアンセットを残します。 Markdownは、応答形式のいずれかで動作します。

Markdownはリアルタイムの問い合わせと完了した結果に利用できます。

下のフィールドは、デフォルトのJSON応答を記述します。

[リクエストとレスポンスの形式例](https://flashdata.dev/ja/docs/guides/response-formats/reference.md#headers)

<a id="job-lifecycle"></a>

<a id="async-batch"></a>

## API の基本

上記のビルダーと例は、このソースのパラメーターを使用します。 Python と cURL の例を以下に使用して、共有の投稿、ステータス、結果の手順を実行します。 Batch ボディは、クエリを含む JSON オブジェクトです。各項目は独自のジョブ ID を返します。

- [Asyncリクエストとレシート](https://flashdata.dev/ja/docs/reference/realtime-and-async/reference.md#async)

<a id="job-status"></a>

- [ジョブステータスの確認](https://flashdata.dev/ja/docs/reference/realtime-and-async/reference.md#status)

<a id="job-results"></a>

- [完了した結果を取得する](https://flashdata.dev/ja/docs/reference/realtime-and-async/reference.md#results)
- [Batch JSON リクエスト](https://flashdata.dev/ja/docs/reference/batch-and-bulk/reference.md#batch)
- [顧客OpenAPI](https://flashdata.dev/docs/openapi.json)

<a id="webhooks"></a>

<a id="callbacks"></a>

## 完了通知

- [完了のWebhooksを受信し、確認する](https://flashdata.dev/ja/docs/guides/async-batch/reference.md#webhooks)

<a id="troubleshooting"></a>

## トラブルシューティング

- [エラーとステータスコード](https://flashdata.dev/ja/docs/errors/reference.md#status-codes)
- [再試行するとき](https://flashdata.dev/ja/docs/errors/reference.md#retries)

## 関連API

- [Google Search API](https://flashdata.dev/ja/docs/sources/google_search/reference.md)
- [Google Images API](https://flashdata.dev/ja/docs/sources/google_images/reference.md)
