# Log in, then extract JSON

Source: https://zshot-cli.com/examples/sales-report-json/
Markdown: https://zshot-cli.com/examples/sales-report-json/index.md
Section: [Examples](https://zshot-cli.com/examples/)
License: [Pro](https://zshot-cli.com/support/licenses/pro)

Sign into [ZRM](https://zshot-cli.com/example_assets/zrm/), switch to the APAC region, open the sales report, and have the formatter return it as JSON constrained by a JSON Schema, saved to [`sales_report.json`](/example-renders/sales-report-json.json). This example uses Anthropic for both the navigator and the formatter, using an API key you must provide.

**CLI**

```sh
zshot -f sales_report.json \
  -t llm_json  \
  --navigate "Login, change the region to APAC, and click on Sales Report" \
  --navigator-credential username=success@zshot-app.com \
  --navigator-credential password=password \
  --navigator-type "anthropic://YOUR_API_KEY@" \
  --llm-format-prompt "The sales report as JSON" \
  --llm-format-expects '{"type":"array","items":{"type":"object","properties":{"company":{"type":"string"},"contact":{"type":"string"},"value":{"type":"number"}}}}' \
  "https://zshot-cli.com/example_assets/zrm/"
```

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

```json
{
  "url": "https://zshot-cli.com/example_assets/zrm/",
  "output_type": "llm_json",
  "navigate": "Login, change the region to APAC, and click on Sales Report",
  "navigator_type": "anthropic://YOUR_API_KEY@",
  "navigator_credential": {
    "username": "success@zshot-app.com",
    "password": "password"
  },
  "llm_format_prompt": "The sales report as JSON",
  "llm_format_expects": {
    "type": "array",
    "items": {
      "type": "object",
      "properties": {
        "company": { "type": "string" },
        "contact": { "type": "string" },
        "value": { "type": "number" }
      }
    }
  }
}
```

**curl**

```sh
curl -X POST http://127.0.0.1:3000/ \
  -H "Content-Type: application/json" \
  -d '{"url":"https://zshot-cli.com/example_assets/zrm/","output_type":"llm_json","navigate":"Login, change the region to APAC, and click on Sales Report","navigator_type":"anthropic://YOUR_API_KEY@","navigator_credential":{"username": "success@zshot-app.com","password": "password"}, "llm_format_prompt": "The sales report as JSON", "llm_format_expects": { "type": "array", "items": { "type": "object", "properties": { "company": { "type": "string" }, "contact": { "type": "string" }, "value": { "type": "number" } } } }}' \
  -o sales_report.json
```

Expected output: [sales-report-json.json](/example-renders/sales-report-json.json)

```
[
  {
    "company": "Acme Staffing",
    "contact": "Kyle Saito",
    "value": 1272000
  },
  {
    "company": "Globex Technologies",
    "contact": "Chad Petrov",
    "value": 1227000
  },
  {
    "company": "Abstergo Procurement",
    "contact": "Lena Nakamura",
    "value": 1211000
  },
  {
    "company": "Spectre Staffing",
    "contact": "Roman Whitaker",
    "value": 1135000
  },
  {
    "company": "Spectre Staffing",
    "contact": "Cheryl Ferreira",
    "value": 1119000
  },
  {
    "company": "Globex Technologies",
… 304 more lines
```

## Related

Flags:

- [`--navigate`](https://zshot-cli.com/reference/flags/navigator/navigate/)
- [`--navigator-type`](https://zshot-cli.com/reference/flags/navigator/navigator-type/)
- [`--navigator-credential`](https://zshot-cli.com/reference/flags/navigator/navigator-credential/)
- [`--llm-format-prompt`](https://zshot-cli.com/reference/flags/document/llm-format-prompt/)
- [`--llm-format-expects`](https://zshot-cli.com/reference/flags/document/llm-format-expects/)
- [`--llm-format-model`](https://zshot-cli.com/reference/flags/document/llm-format-model/)
- [`--output-type`](https://zshot-cli.com/reference/flags/common/output-type/)

Topics:

- [LLM JSON](https://zshot-cli.com/reference/formats/llm_json/) — Use an LLM to convert the page contents to JSON
- [LLM Connections](https://zshot-cli.com/reference/llm_connections/) — Select an agent navigation backend and formatter backend

## 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](https://zshot-cli.com/examples/geolocation/)
  - [Log in, then capture](https://zshot-cli.com/examples/navigate-login/)
  - **Log in, then extract 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

