Skip to content

update project

Adrian Gortzak edited this page Jun 13, 2025 · 16 revisions

Create or update projects

The code below gives an example of how to use the client to create or update a project.

import valueguard

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

print(vgClient.project_update(search_criteria={
        "id": "1fb9ca75-590a-42de-8269-5312b854917b",
        "name": "Kantorsgatan 53, Uppsala",
        "created_at": "2023-01-23",
        "updated_at": "2023-11-23",
        "ad_references_search_criteria": {
            "home_type":[],
            "ownership_type":[],
            "wgs84lat": null,
            "wgs84lon": null,
            "price_reference": null,
            "living_area_reference": null,
            "floor_reference": null,
            "floors_reference": null,
            "rooms_reference": null,
            "ancillary_area_reference": null,
            "construction_year_reference": null,
            "monthly_fee_reference": null,
            "selected_ids": [
              "1fb9ca75-590a-42de-8269-5312b854917b",
              "1fb9ca75-590a-42de-8129-5312l274092t"
            ],
            "excluded_ids": [
              "1fb9ca75-590a-42de-8129-5312l274092t",
              "5ac5fc11-9a4e-86gi-2565-9756p618436x"
            ],
            "limit": 20,
            "registered_date_weight": 500,
            "living_area_weight": 500,
            "construction_year_weight": 500,
            "monthly_fee_weight": 500,
            "floor_weight": 500,
            "floors_weight": 500,
            "rooms_weight": 500,
            "population_center_weight": 500,
            "distance_weight": 500,
            "ancillary_area_weight": 500,
            "price_min":null,
            "price_max":null,
            "living_area_min":null,
            "living_area_max":null,
            "rooms_min":null,
            "rooms_max":null,
            "construction_year_min":null,
            "construction_year_max":null,
            "advertising_days_min":null,
            "advertising_days_max":null,
            "error_code":null,
            "is_new_construction":null
        },
        "sale_references_search_criteria": {
            "home_type":[],
            "ownership_type":[],
            "living_area_reference": null,
            "wgs84lat": null,
            "wgs84lon": null,
            "floor_reference": null,
            "floors_reference": null,
            "rooms_reference": null,
            "ancillary_area_reference": null,
            "construction_year_reference": null,
            "monthly_fee_reference": null,
            "estate_agency_group": null,
            "monthly_fee_min": null,
            "monthly_fee_max": null, 
            "use_fpr_data": false,
            "contract_date_weight": 500,
            "living_area_weight": 500,
            "selected_ids": [
              "2fa8cb84-671b-53df-9238-6423m385103u",
              "3ec7da93-782c-64eg-0347-7534n496214v"
            ],
            "excluded_ids": [
             "4bd6eb02-893d-75fh-1456-8645o507325w",
             "6db4gd20-ab5f-97hj-3674-a867q729547y"
            ],
            "construction_year_weight": 500,
            "monthly_fee_weight": 500,
            "floor_weight": 500,
            "floors_weight": 500,
            "rooms_weight": 500,
            "population_center_weight": 500,
            "distance_weight": 500
        },
        "ads_market_share_search_criteria": {
            "home_type":[],
            "ownership_type":[],
            "rooms_min": null,
            "rooms_max": null,
            "living_area_min": null,
            "living_area_max": null,
            "construction_year_min": null,
            "construction_year_max": null,
            "ancillary_area_min": null,
            "ancillary_area_max": null,
            "price_min": null,
            "price_max": null,
            "monthly_fee_min": null,
            "monthly_fee_max": null,
            "registered_date_min": null,
            "registered_date_max": null,
            "rt90x_min": null,
            "rt90x_max": null,
            "rt90y_min": null,
            "rt90y_max": null
        },
        "index_normalized_search_criteria": {
            "id": null,
            "reference_value": 100.0,
            "reference_date": null
        }
}))

Field list

Field name Description Example
id ID of the project a5bb766e-453d-4e85-a92c-f2c51b86c332
name Name of the project Bergslagsresan 155
created_at Date when the project was created 2023-11-23
updated_at Date when the project was updated 2024-01-01
search_criteria saved search_criteria { ads_reference{}, sales_reference{} }

Post criteria fields

Field name Description Example
id ID of the project a5bb766e-453d-4e85-a92c-f2c51b86c332
name Name of the project Bergslagsresan 155
created_at Date when the project was created 2023-11-23
updated_at Date when the project was updated 2024-01-01
ad_references_search_criteria Saved search criteria for ads_references See ads reference
sale_references_search_criteria Saved search criteria for sales_references See sales reference
ads_market_share_search_criteria Saved search criteria for ads_market_share See ads market share
index_normalized_search_criteria Saved search criteria for index_normalized See index normalized

Json body

{
        "id": "1fb9ca75-590a-42de-8269-5312b854917b",
        "name": "Kantorsgatan 53, Uppsala",
        "created_at": "2023-01-23",
        "updated_at": "2023-11-23",
        "ads_reference_selected_ad_ids": [
            "1fb9ca75-590a-42de-8269-5312b854917b",
            "1fb9ca75-590a-42de-8129-5312l274092t"
        ],
        "ads_reference_excluded_ad_ids": [
            "1fb9ca75-590a-42de-8129-5312l274092t",
            "5ac5fc11-9a4e-86gi-2565-9756p618436x"
        ],
        "ad_references_search_criteria": {
            "category": null,
            "wgs84lat": null,
            "wgs84lon": null,
            "price_reference": null,
            "living_area_reference": null,
            "floor_reference": null,
            "floors_reference": null,
            "rooms_reference": null,
            "ancillary_area_reference": null,
            "construction_year_reference": null,
            "monthly_fee_reference": null,
            "limit": 20,
            "registered_date_weight": 500,
            "living_area_weight": 500,
            "construction_year_weight": 500,
            "monthly_fee_weight": 500,
            "floor_weight": 500,
            "floors_weight": 500,
            "rooms_weight": 500,
            "population_center_weight": 500,
            "distance_weight": 500,
            "ancillary_area_weight": 500
        },
        "sales_reference_selected_sale_ids": [
            "2fa8cb84-671b-53df-9238-6423m385103u",
            "3ec7da93-782c-64eg-0347-7534n496214v"
        ],
        "sales_reference_excluded_sale_ids": [
            "4bd6eb02-893d-75fh-1456-8645o507325w",
            "6db4gd20-ab5f-97hj-3674-a867q729547y"
        ],
        "sale_references_search_criteria": {
            "category": null,
            "living_area_reference": null,
            "wgs84lat": null,
            "wgs84lon": null,
            "floor_reference": null,
            "floors_reference": null,
            "rooms_reference": null,
            "ancillary_area_reference": null,
            "construction_year_reference": null,
            "monthly_fee_reference": null,
            "estate_agency_group": null,
            "use_fpr_data": false,
            "contract_date_weight": 500,
            "living_area_weight": 500,
            "construction_year_weight": 500,
            "monthly_fee_weight": 500,
            "floor_weight": 500,
            "floors_weight": 500,
            "rooms_weight": 500,
            "population_center_weight": 500,
            "distance_weight": 500
        },
        "ads_market_share_search_criteria": {
            "category": null,
            "rooms_min": null,
            "rooms_max": null,
            "living_area_min": null,
            "living_area_max": null,
            "construction_year_min": null,
            "construction_year_max": null,
            "ancillary_area_min": null,
            "ancillary_area_max": null,
            "price_min": null,
            "price_max": null,
            "monthly_fee_min": null,
            "monthly_fee_max": null,
            "registered_date_min": null,
            "registered_date_max": null,
            "rt90x_min": null,
            "rt90x_max": null,
            "rt90y_min": null,
            "rt90y_max": null
        },
        "index_normalized_search_criteria": {
            "id": null,
            "reference_value": 100.0,
            "reference_date": null
        }
}

Raw request

Post (Create/Update)

curl https://api-prod.valueguard.se/v1/projects/{id}?access_token={access_token}
body: json body

Clone this wiki locally