# Emulate geolocation

Source: https://zshot-cli.com/examples/geolocation/
Markdown: https://zshot-cli.com/examples/geolocation/index.md
Section: [Examples](https://zshot-cli.com/examples/)

Capture [Where am I?](https://zshot-cli.com/example_assets/whereami/), a page that maps whatever `navigator.geolocation` reports, with the browser placed at [Wall Drug](https://www.walldrug.com), South Dakota, saved to [`whereami.png`](/example-renders/geolocation.png).

**CLI**

```sh
zshot -f whereami.png \
  -x 880 -y 700 \
  --wait-for js:whereami:ready \
  --emulate-geolocation "geo:43.993184992771454,-102.24168045794855" \
  https://zshot-cli.com/example_assets/whereami/
```

**JSON** — `POST /` body for the [API](/reference/server/api), Pro license

```json
{
  "url": "https://zshot-cli.com/example_assets/whereami/",
  "output_type": "png",
  "browser_width": 880,
  "browser_height": 700,
  "emulate_geolocation": "geo:43.993184992771454,-102.24168045794855",
  "wait_for": "js:whereami:ready"
}
```

**curl**

```sh
curl -X POST http://127.0.0.1:3000/ \
  -H "Content-Type: application/json" \
  -d '{"url":"https://zshot-cli.com/example_assets/whereami/","output_type":"png","browser_width":880,"browser_height":700,"emulate_geolocation":"geo:43.993184992771454,-102.24168045794855","wait_for":"js:whereami:ready"}' \
  -o whereami.png
```

Expected output: [geolocation.png](/example-renders/geolocation.png) — A map centered on Wall, South Dakota, with a pin and the reported coordinates above it

## Related

Flags:

- [`--emulate-geolocation`](https://zshot-cli.com/reference/flags/browser/emulate-geolocation/)
- [`--wait-for`](https://zshot-cli.com/reference/flags/common/wait-for/)
- [`--browser-width`](https://zshot-cli.com/reference/flags/browser/browser-width/)
- [`--browser-height`](https://zshot-cli.com/reference/flags/browser/browser-height/)

Topics:

- [Browser](https://zshot-cli.com/reference/flags/browser/) — Viewport, device and emulation flags

## Navigation

- [Examples](https://zshot-cli.com/examples/)
  - [Webpage as PNG](https://zshot-cli.com/examples/hello-from-zshot/)
  - [Full-page phone screenshot](https://zshot-cli.com/examples/full-page-phone/)
  - [Wait for a JavaScript event](https://zshot-cli.com/examples/wait-for-event/)
  - [Rendered HTML](https://zshot-cli.com/examples/html-output/)
  - [Tablet screenshot](https://zshot-cli.com/examples/tablet-screenshot/)
  - [Accessible PDF](https://zshot-cli.com/examples/accessible-pdf/)
  - [WebM video](https://zshot-cli.com/examples/webm-video/)
  - [Animated GIF](https://zshot-cli.com/examples/animated-gif/)
  - [Dark mode](https://zshot-cli.com/examples/dark-mode/)
  - **Emulate geolocation**
  - [Log in, then capture](https://zshot-cli.com/examples/navigate-login/)
  - [Log in, then extract JSON](https://zshot-cli.com/examples/sales-report-json/)
  - [Upload a file, download the result](https://zshot-cli.com/examples/enhance-leads/)
  - [Crawl a site into a WACZ](https://zshot-cli.com/examples/crawl-links/)
  - [Archive a sitemap into a WACZ](https://zshot-cli.com/examples/wacz-sitemap/)
  - [Run an API server](https://zshot-cli.com/examples/api-server/)
  - [Signed URL support](https://zshot-cli.com/examples/menu-board/)
  - [Browser as a CDN](https://zshot-cli.com/examples/browser-as-a-cdn/)
- [Download](https://zshot-cli.com/download/)
- [Purchase](https://zshot-cli.com/purchase/)
- [Reference](https://zshot-cli.com/reference/)
- [Support](https://zshot-cli.com/support/)
- [Changelog](https://zshot-cli.com/changelog/)

Site index: https://zshot-cli.com/llms.txt

