# Migrate from Outscraper (photos)

> Move Outscraper Google Maps Photos calls, including owner photos with tag=by_owner, to /v1/business/google/photos.

`GET /v1/business/google/photos` accepts Outscraper's Google Maps Photos parameters and returns its response body. It runs synchronously: the photos come back in the same response.

> **Note:** Beta: the photos parser was written from public documentation and hasn't been checked against a live response yet.

## 1. Change the request

| | Outscraper | DataForGAIO |
|---|---|---|
| URL | Outscraper's Google Maps Photos endpoint | `https://api.dataforgaio.com/v1/business/google/photos` |
| Auth | Your Outscraper API key | Your `dg_` key in `X-API-Key`, a Bearer header or Basic auth |
| Async mode | Optional | Not used: every call is synchronous, so there's no request id to poll |



```bash title="cURL"
curl -G "https://api.dataforgaio.com/v1/business/google/photos" \
  -H "X-API-Key: $DATAFORGAIO_API_KEY" \
  --data-urlencode "query=Blue Bottle Coffee, 1 Ferry Building, San Francisco" \
  --data-urlencode "tag=by_owner" \
  --data-urlencode "photosLimit=20"
```

```python title="Python"
import os
import requests

res = requests.get(
    "https://api.dataforgaio.com/v1/business/google/photos",
    params={"query": "Blue Bottle Coffee, 1 Ferry Building, San Francisco", "tag": "by_owner", "photosLimit": 20},
    headers={"X-API-Key": os.environ["DATAFORGAIO_API_KEY"]},
    timeout=120,
)
body = res.json()
for place in body["data"]:
    for p in place[0]["photos_data"]:
        print(p["photo_id"], p["original_photo_url"])
```



## 2. Parameters

| Parameter | Default | Notes |
|---|---|---|
| `query` | required | A name and address, a `place_id`, a `google_id` (`0x...:0x...`) or a CID. Up to 25 queries, newline-separated in one `query` parameter. Repeating the parameter keeps only the last value. |
| `photosLimit` | 100 | Photos per place, 1 to 1,000. `photos_limit` also works. |
| `tag` | `all` | `all`, `latest`, `menu`, `by_owner` or `videos`. |
| `language` | `en` | |
| `region` | `us` | 2-letter country. |
| `limit` | | Accepted for compatibility; one place is returned per query. |
| `auto_upgrade`, `max_level`, `max_cost`, `max_age` | | Our [request controls](/docs/making-requests#request-controls). `max_cost` caps the number of images: `max_cost=0.018` returns at most 20. |

## 3. Response

```json
{
  "id": "5b1f0d9c-...",
  "status": "Success",
  "receipt_id": "9a2e...",
  "cost": 0.018,
  "fetch_level": "standard",
  "upgraded": false,
  "upgrade_reason": null,
  "cache_hit": false,
  "data": [
    [
      {
        "query": "Blue Bottle Coffee, 1 Ferry Building, San Francisco",
        "name": "Blue Bottle Coffee",
        "place_id": "ChIJ...",
        "google_id": "0x808f...:0x2c1d...",
        "full_address": "1 Ferry Building #7, San Francisco, CA 94111",
        "photos_data": [
          {
            "photo_id": "AF1Qip...",
            "photo_url": "https://...=w1024-h768-k-no",
            "photo_url_big": "https://...=w2048-h1536-k-no",
            "original_photo_url": "https://...=s0",
            "latitude": null,
            "longitude": null,
            "photo_date": null,
            "photo_upload_source": "owner",
            "photo_source_video": null,
            "photo_tags": ["by_owner"]
          }
        ]
      }
    ]
  ]
}
```

`data` has one list per query, each holding one place. Differences from Outscraper:

- `receipt_id`, `cost`, `fetch_level`, `upgraded`, `upgrade_reason` and `cache_hit` are ours.
- `latitude`, `longitude`, `photo_date` and `photo_source_video` are `null`; we return photo URLs, not their metadata.
- `photo_upload_source` is `"owner"` when you asked for `tag=by_owner`, otherwise `null`.

## 4. Pricing and errors

- $0.0009 per image returned ($0.90 per 1,000). A query that finds no place, or a place with no photos for the tag, costs $0.
- Results are cached for 24 hours per query, tag, language and region.
- Errors return `{"id", "status": "Error", "error": true, "errorMessage", "receipt_id"}` with HTTP 400 (invalid input, or no places found), 401, 402, 429 or 500. None are billed.

See [Google Business Photos](https://dataforgaio.com/docs/api/business-google-photos.md) for every field.
