Skip to content

sales reference

Adrian Gortzak edited this page Aug 7, 2025 · 50 revisions

Get sales reference

The code below gives an example of how to use the client to get sales references.

import valueguard

vgClient = valueguard.Client()
vgClient.authenticate("<username>", "<password>")


print(vgClient.sales_reference(search_criteria={
    "category":"apartment",
    "living_area_reference":"78",
    "wgs84lat":"59.864908174031974",
    "wgs84lon":"17.648463519218435"
}))

Response

Field list

Field name Description Example
id sale id ef0d6559-0358-11ef-b390-0242ac110006
street Street name in address 1:a villagatan
number Street number in address 1
letter Letter after street number in address, if any A
rooms Number of rooms for areas above 7sqm,
excluding kitchen and bathroom
5
living_area Area of residence in sqm 137
floor The floor of the residence 2
floors The highest floor on the address 2
construction_year Year it was built 1920
category Type of residence: apartment, house, plot, terraced_house, townhouse apartment
plot_area Area of the plot belonging to the residence in sqm 896
sold_price Price the property was sold for 1900000
monthly_fee Monthly fee 3654
rt90x X-coordinate (longitude) from RT90.
a Swedish positioning system by LMV used before 2007
6586700.0
rt90y Y-coordinate (latitude) from RT90.
a Swedish positioning system by LMV used before 2007
1367905.0
wgs84lon longitude from wgs84 17.651505
wgs84lat latitude from wgs84 59.868478
recounted_price Recounted price to current value 2300000
contract_date The day the sales contract was signed for the object 2018-03-12
relevance relevance score on the sold residence, lower is better 0.32
own_sale if the sale is from the same real estate agency as the logged-in user.
null = No real estate agency set
True = From the same real estate agency
False = Not from the same real estate agency
True
polygons GeoJSON format for the search region View Example

GeoJson

Here is a simple example of a GeoJSON format that can be used for filtering.

Polygon

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [17.5288, 59.7500],
            [17.8094, 59.7500],
            [17.8094, 60.0000],
            [17.5288, 60.0000],
            [17.5288, 59.7500]
          ]
        ]
      },
      "properties": {}
    }
  ]
}

Multipolygon

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
          [
            [
              [17.638927, 59.858562],
              [17.641931, 59.858562],
              [17.641931, 59.860562],
              [17.638927, 59.860562],
              [17.638927, 59.858562]
            ]
          ],
          [
            [
              [17.650927, 59.857562],
              [17.653931, 59.857562],
              [17.653931, 59.859562],
              [17.650927, 59.859562],
              [17.650927, 59.857562]
            ]
          ]
        ]
      },
      "properties": {}
    }
  ]
}

Summary

Field name Description Example
id Id of the summary 324234
average_rooms Average amount of rooms for all objects 3
average_living_area Average living area in sqm for all objects 72
average_ancillary_area Average ancillary area in sqm (not part of the primary building area) for all objects 25
average_construction_year Average construction year for all objects 1985
average_price Average price for all objects 2100000
average_recounted_price Average price today for all objects 2600000
average_monthly_fee Average monthly fee for all objects 2300
average_registered_date Average registered date for all objects "2024-02-02"
average_monthly_fee_per_square Average monthly fee per sqm for all objects 45
average_price_per_square Average price per square for all objects 24000
average_distance Average distance between all objects in meters 28

Search criteria fields

Reference objects

Field name Description Example
living_area_reference Area of residence in sqm 78
wgs84lat Y-coordinate (latitude) from WGS84.
a global positioning system
59.864908174031974
wgs84lon X-coordinate (longitude) from WGS84.
a global positioning system
17.648463519218435
floor_reference The floor of this particular residence 3
floors_reference The highest floor on the address 4
rooms_reference Number of rooms 4
construction_year_reference Year it was built 1976
monthly_fee_reference Monthly fee 6000
use_fpr_data Use data from fastighetsprisregistret False

Filter objects

Field name Description Example
category List of category of residence [apartment, house, farm, plot, terraced_house, townhouse]
form_of_ownership List of form of ownership of residence [co_operative_apartment, lease, property_rights, site_leasehold, unknown]
estate_agencies List of estate agencies [mäklarbyrån, bästa mäklare ab]
registered_date_min Earliest date when the ad can be registered 2022-03-23
registered_date_max Latest date when the ad can be registered 2023-03-23
price_min Lowest allowed price on the ad 1900000
price_max Highest allowed price on the ad 2900000
living_area_min Lowest allowed area of residence in sqm 78
living_area_max Highest allowed area of residence in sqm 88
rooms_min Lowest allowed nubmer of rooms 3
rooms_max Highest allowed nubmer of rooms 4
floor_min Lowest allowed floor the apartment can be located on 2
floor_max Highest allowed floor the apartment can be located on 3
construction_year_min Earliest allowed year when the building was built 1956
construction_year_max Latest allowed year when the building was built 1986
advertising_days_min Lowest amount of days the ad is allowed to have been active 10
advertising_days_max Highest amount of days the ad is allowed to have been active 30
error_code 1 = suspected error in data
0 = no suspected error in data
0
is_close_to_population_centre If the property needs to be in proximity to population centers. 0
is_new_construction Show obejcts that are likely new construction. 0
excluded_ids list of sales that have been filtered out ["f840b503-7b97-11ef-b390-0242ac110006", "f840d718-0075-11ed-80f2-0242ac110002", "f840ff7e-7b97-11ef-b390-0242ac110006"]
limit Maximum number of responses 20
rt90x_square_min Minimum RT90 X-coordinate of the search square 6580000
rt90x_square_max Maximum RT90 X-coordinate of the search square 6581000
rt90y_square_min Minimum RT90 Y-coordinate of the search square 1620000
rt90y_square_max Maximum RT90 Y-coordinate of the search square 1621000

Weights

Reflecting importance in the reference sales search, between 0 to 1000

Field Name Description Default Example
contract_date_weight Weight assigned to the contract date. 500 900
living_area_weight Weight given to the living area. 500 500
construction_year_weight Weight allocated to the year of construction. 500 350
monthly_fee_weight Weight for the monthly fee. 500 600
floor_weight Weight of the property's floor level. 500 500
floors_weight Weight for the total number of floors in the building. 500 400
rooms_weight Weight assigned to the number of rooms. 500 700
population_center_weight Weight for the property's proximity to population centers. 500 500
distance_weight Weight for the distance to the reference sale. 500 800

Raw request

POST

## Raw request
#### Post
curl --location 'https://api.valueguard.se/v1/sales/reference?access_token=<ACCESS_TOKEN>' \
--data '{"living_area_reference":78,"rooms_reference":1,"advertising_days_min":0,"advertising_days_max":500,"home_type":["apartment","house"],
"ownership_type":["property_rights"],"living_area_min":0,"living_area_max":500,"rooms_min":0,"rooms_max":10,"error_code":0,"excluded_ids":[],"limit":15,"selected_ids":[],"wgs84lat":"59.85856380000001","wgs84lon":"17.6389267"}'

Clone this wiki locally