---
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`

## Request

- Base URL: `https://prices.openfoodfacts.org` (the document declares no server; this is the origin it was published from)
- URL: `https://prices.openfoodfacts.org/api/v1/locations/compare`
- Auth: none declared

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_tags` string[]
    - `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
    - `osm_version_date` string, date-time, 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_tags` string[]
    - `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
    - `osm_version_date` string, date-time, 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

## Changes

- **2026-09-24** `cf7a76a46395`: 2 info
  - added the optional property `location_a/osm_tags` to the response with the `200` status
  - added the optional property `location_b/osm_tags` to the response with the `200` status
- **2026-09-16** `fd287e13ea64`: 2 info
  - added the optional property `location_a/osm_version_date` to the response with the `200` status
  - added the optional property `location_b/osm_version_date` to the response with the `200` status
- **2026-07-13** `f1bb01adae9b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-prices-rest-api/changes/api/v1/locations/compare/get.md)

---

[API](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-prices-rest-api.md) - [All operations](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-prices-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-prices-rest-api/revisions/d7c5d8b4c32e?raw)
