---
title: "GET /api/v1/locations/compare"
method: GET
path: "/api/v1/locations/compare"
tags: ["locations"]
---

# GET /api/v1/locations/compare

`GET /api/v1/locations/compare`

Compare two locations by their IDs.
Returns shared product prices with the latest price per location,
the date of that price, and the total sum.

## Query parameters

- `date__gte` string, date
- `date__lte` string, date
- `location_id_a` integer, required
- `location_id_b` integer, required
- `price_is_discounted` boolean

## Response `200`

- LocationCompare
  - `location_a` Location, required
    - `id` integer, required
    - `osm_brand_logo_url` string, required
    - `type` 'OSM' | 'ONLINE', required — * `OSM` - OSM * `ONLINE` - ONLINE
    - `osm_id` integer, nullable
    - `osm_type` union
      - 'NODE' | 'WAY' | 'RELATION' — * `NODE` - NODE * `WAY` - WAY * `RELATION` - RELATION
      - ''
      - unknown
    - `osm_name` string, nullable
    - `osm_display_name` string, nullable
    - `osm_tag_key` string, nullable
    - `osm_tag_value` string, nullable
    - `osm_brand` string, nullable
    - `osm_address_postcode` string, nullable
    - `osm_address_city` string, nullable
    - `osm_address_country` string, nullable
    - `osm_address_country_code` string, nullable
    - `osm_lat` number, double, nullable
    - `osm_lon` number, double, nullable
    - `osm_version` integer, nullable
    - `website_url` string, uri, nullable
    - `price_count` integer
    - `user_count` integer
    - `product_count` integer
    - `proof_count` integer
    - `source` string, nullable
    - `created` string, date-time
    - `updated` string, date-time, required
  - `location_b` Location, required
    - `id` integer, required
    - `osm_brand_logo_url` string, required
    - `type` 'OSM' | 'ONLINE', required — * `OSM` - OSM * `ONLINE` - ONLINE
    - `osm_id` integer, nullable
    - `osm_type` union
      - 'NODE' | 'WAY' | 'RELATION' — * `NODE` - NODE * `WAY` - WAY * `RELATION` - RELATION
      - ''
      - unknown
    - `osm_name` string, nullable
    - `osm_display_name` string, nullable
    - `osm_tag_key` string, nullable
    - `osm_tag_value` string, nullable
    - `osm_brand` string, nullable
    - `osm_address_postcode` string, nullable
    - `osm_address_city` string, nullable
    - `osm_address_country` string, nullable
    - `osm_address_country_code` string, nullable
    - `osm_lat` number, double, nullable
    - `osm_lon` number, double, nullable
    - `osm_version` integer, nullable
    - `website_url` string, uri, nullable
    - `price_count` integer
    - `user_count` integer
    - `product_count` integer
    - `proof_count` integer
    - `source` string, nullable
    - `created` string, date-time
    - `updated` string, date-time, required
  - `shared_products` unknown, required
  - `total_sum_location_a` number, double, required
  - `total_sum_location_b` number, double, required

---

[API](https://skmtc.net/openfoodfacts/apis/open-food-facts-open-prices-rest-api.md) · [All operations](https://skmtc.net/openfoodfacts/apis/open-food-facts-open-prices-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openfoodfacts/open-food-facts-open-prices-rest-api/revisions/2315a270e4e6/schema)
