### Usage Example for metrics.unitList.impression
Source: https://developers.sightmap.com/docs/sightmap-metrics-api
This JavaScript snippet demonstrates how to listen for and log the 'metrics.unitList.impression' event. Ensure the 'embed' object is available in your scope.
```javascript
embed.on('metrics.unitList.impression', function (event) {
console.log(event);
});
```
--------------------------------
### SightMap Embedded In-line Example
Source: https://developers.sightmap.com/docs/add-sightmap-embed-in-line
A practical example demonstrating an in-line SightMap embed within a web page. Note that the map size in online examples may differ from its appearance on an actual website.
```html
```
--------------------------------
### Usage Example for metrics.unitList.change
Source: https://developers.sightmap.com/docs/sightmap-metrics-api
This JavaScript code shows how to subscribe to the 'metrics.unitList.change' event and log the received event data. Ensure the 'embed' object is accessible.
```javascript
embed.on('metrics.unitList.change', function (event) {
console.log(event);
});
```
--------------------------------
### JSFiddle Example for Listening to Metrics Events
Source: https://developers.sightmap.com/docs/quick-start-and-usage-requirements
This JSFiddle demonstrates how to listen for metrics events from the SightMap API and log them to the console. A commented-out snippet shows how to push event data to a GTM datalayer.
```javascript
```
--------------------------------
### SightMap Dependencies for FancyBox
Source: https://developers.sightmap.com/docs/adding-sightmap-as-a-pop-up-iframe
Include these scripts and stylesheets for jQuery and FancyBox to enable modal pop-ups. This setup is required before implementing the SightMap iframe.
```html
```
--------------------------------
### API Pagination Example
Source: https://developers.sightmap.com/docs/rest-api-faq
This JSON snippet illustrates the structure of the paging information returned by the API. It shows how to control the number of results per page and navigate through different pages.
```json
"paging": {
"per_page": 1000,
"current_page": 1,
"prev_url": null,
"next_url": null
}
```
--------------------------------
### List Unit Reference Groups Example
Source: https://developers.sightmap.com/docs/pulling-unit-floor-plan-data
This JSON response shows the structure of unit reference groups for an asset. It includes IDs, names, and keys for PMS integrations.
```json
{
"data": [
{
"id": "39275",
"asset_id": "7778",
"name": "[SALES DEMO] The Milo - Garden",
"description": "Sample Yardi Rentcafe Data",
"key": "yardi-rentcafe",
"created_at": "2026-04-16T03:27:09+00:00",
"updated_at": "2026-04-16T03:27:09+00:00"
}
]
}
```
--------------------------------
### Initiate and Commit a Transaction
Source: https://developers.sightmap.com/docs/pushing-pricing-data-to-sightmap
This describes how to initiate a new transaction and commit data. For a single data set, use `commit=1`. For multiple requests within a transaction, start with `commit=0` and end with `commit=1`.
```APIDOC
## POST /v1/assets/{asset}/multifamily/pricing/{process}/ingest
### Description
Initiates a pricing data ingestion transaction. Use `commit=1` to send a complete dataset and commit the transaction in one request. Use `commit=0` to start a transaction that will involve multiple requests.
### Method
POST
### Endpoint
`https://api.sightmap.com/v1/assets/{asset}/multifamily/pricing/{process}/ingest?commit={0 or 1}`
### Parameters
#### Query Parameters
- **commit** (integer) - Required - Set to `1` to commit the transaction immediately, or `0` to keep the transaction open for subsequent requests.
### Request Body
Data must be sent as JSON.
### Response
#### Success Response (200)
- **transaction_ingest_url** (string) - The URL for the transaction, containing a transaction ID, if `commit=0` was used.
#### Headers
- **Link** (string) - Contains the transaction URL and relation, e.g., `; rel="transaction"`
```
--------------------------------
### Example Floor Plan Data Response
Source: https://developers.sightmap.com/docs/pulling-unit-floor-plan-data
This JSON structure represents the data returned when listing floor plans for an asset. It includes details like floor plan ID, name, bedroom/bathroom counts, and image URLs.
```json
"data": [
{
"id": "133265",
"asset_id": "7778",
"name": "B1",
"filter_label": "B1",
"bedroom_count": 2,
"bathroom_count": 2,
"show_bedroom_count": true,
"show_bathroom_count": true,
"show_unit_area": true,
"provider_id": null,
"provider_group_id": null,
"image_url": "https://cdn.sightmap.com/assets/e8/yw/e8ywk1eqplx/94/a4/94a4cfeed2a283563fedca6803f12df6.jpg",
"secondary_image_url": "https://cdn.sightmap.com/assets/e8/yw/e8ywk1eqplx/3a/4f/3a4fae12b128e721bcc72295f4c5bd7a.jpg",
"updated_at": "2024-07-18T16:18:41+00:00",
"created_at": "2020-11-09T15:58:33+00:00"
},
{
"id": "133266",
"asset_id": "7778",
"name": "A1",
"filter_label": "A1",
"bedroom_count": 1,
"bathroom_count": 1,
"show_bedroom_count": true,
"show_bathroom_count": true,
"show_unit_area": true,
"provider_id": null,
"provider_group_id": null,
"image_url": "https://cdn.sightmap.com/assets/e8/yw/e8ywk1eqplx/9c/67/9c673706b34632da1a95bf1058c1389a.jpg",
"secondary_image_url": "https://cdn.sightmap.com/assets/e8/yw/e8ywk1eqplx/f4/44/f444b00b336a01380a895e4b772f0111.jpg",
"updated_at": "2024-07-18T16:16:56+00:00",
"created_at": "2020-11-09T15:58:33+00:00"
},
```
--------------------------------
### SightMap JavaScript IFrame API Example
Source: https://developers.sightmap.com/docs/quick-start-and-usage-requirements
This HTML document demonstrates how to include the SightMap API script, embed the iframe with necessary parameters, and initialize the SightMap Embed object. Ensure the origin parameter in the iframe src is updated to match your local development server.
```html
SightMap JavaScript IFrame API Example
```
--------------------------------
### Example Request Body for SightMap Pricing Data
Source: https://developers.sightmap.com/docs/pushing-pricing-data-to-sightmap
This JSON structure represents the data for units, including pricing, availability, and optional leasing fields. Ensure all required fields are present for accurate data submission.
```json
[
{
"unit_number": "E13",
"provider_id": "4931598",
"price": 1619,
"lease_term": 11,
"available_on": "2020-12-05",
"lease_starts_on": "2021-12-07",
"leasing_fields": {
"floorplan_id": "1040185",
"unit_space_id": "4931598",
"apply_url": "https://example.com"
}
},
{
"unit_number": "W13",
"provider_id": "4931598",
"price": 1619,
"lease_term": 10,
"available_on": "2020-12-05",
"lease_starts_on": "2021-12-07",
"specials_description": "$500 off first month's rent",
"leasing_fields": {
"floorplan_id": "1040185",
"unit_space_id": "4931598",
"apply_url": "https://example.com"
}
}
]
```
--------------------------------
### Combined Sightmap Functionality Demo
Source: https://developers.sightmap.com/docs/sightmap-javascript-iframe-api
A jQuery-based example demonstrating combined Sightmap functionalities including setting unit matches, locating units, switching floors, and disabling UI elements. Note that maps in JSFiddles are scaled and will be larger on an actual website.
```html
```
--------------------------------
### HTML and CSS for Referenced Model Integration
Source: https://developers.sightmap.com/docs/sightmap-integration-models-for-websites
Use this HTML and CSS structure to create custom markers and bullets for displaying information related to floor plans and units when integrating the SightMap Referenced Model. This setup helps in visually distinguishing different types of information presented to the user.
```html
SightMap Integration
1Users can click to view a pop-up modal of your map, highlighting individual floor plans and units.
—SightMap iFrame is still treated separately from the website’s traditional search experience.
```
--------------------------------
### HTML Embed Code Example
Source: https://developers.sightmap.com/docs/add-sightmap-embed-in-line
This is the basic HTML embed code for integrating SightMap directly into your web page. Ensure the container is adequately sized to accommodate the iframe and its margins.
```html
```
--------------------------------
### SightMap in Pure JS Modal
Source: https://developers.sightmap.com/docs/adding-sightmap-as-a-pop-up-iframe
An example of embedding SightMap within a pure JavaScript modal implementation. This approach avoids external library dependencies like FancyBox.
```html
```
--------------------------------
### Unmatched Pricing Unit Example
Source: https://developers.sightmap.com/docs/pushing-pricing-data-to-sightmap
This JSON structure represents a pricing unit that may not be displaying correctly due to missing provider ID mapping. Review and update the `provider_id` to resolve display issues.
```json
{
"id": "966828",
"pricing_id": "3580",
"provider_id": null,
"unit_number": "010124",
"status": null,
"price": null,
"full_price": null,
"specials_description": null,
"available_on": null,
"updated_at": "2020-04-29T18:53:49+00:00",
"created_at": "2020-04-29T18:53:49+00:00"
}
```
--------------------------------
### List References for Unit Reference Group Example
Source: https://developers.sightmap.com/docs/pulling-unit-floor-plan-data
This JSON response provides unit references for a specific group, including the unit ID, group ID, PMS-side value, and asset details. This is used to join back to unit data from Step 1.
```json
"data": [
{
"asset_id": "7778",
"group_id": "39275",
"unit_id": "2879571",
"key": "yardi-rentcafe",
"value": "12345",
"created_at": "2026-04-16T03:27:09+00:00",
"updated_at": "2026-04-16T03:27:09+00:00"
},
{
"asset_id": "7778",
"group_id": "39275",
"unit_id": "2879572",
"key": "yardi-rentcafe",
"value": "12346",
"created_at": "2026-04-16T03:27:09+00:00",
"updated_at": "2026-04-16T03:27:09+00:00"
},
{
"asset_id": "7778",
"group_id": "39275",
"unit_id": "2879573",
"key": "yardi-rentcafe",
"value": "12347",
"created_at": "2026-04-16T03:27:09+00:00",
"updated_at": "2026-04-16T03:27:09+00:00"
}
```
--------------------------------
### List Floor Plans for an Asset
Source: https://developers.sightmap.com/docs/pulling-unit-floor-plan-data
Use the GET /v1/assets/{asset_id}/multifamily/floor-plans endpoint to retrieve a list of all floor plans associated with a specific asset. This is useful for ingesting floor plan data for display or further processing.
```APIDOC
## GET: List floor plans
### Description
Retrieves a list of all floor plans for a given asset.
### Method
GET
### Endpoint
/v1/assets/{asset_id}/multifamily/floor-plans
### Parameters
#### Path Parameters
- **asset_id** (string) - Required - The unique identifier of the asset.
### Response
#### Success Response (200)
- **data** (array) - An array of floor plan objects.
- **id** (string) - The floor plan's unique ID.
- **asset_id** (string) - The parent asset's ID.
- **filter_label** (string) - The clean display name shown to end users.
- **bedroom_count** (integer) - The number of bedrooms.
- **bathroom_count** (integer) - The number of bathrooms.
- **show_bedroom_count** (boolean) - Whether to display the bedroom count.
- **show_bathroom_count** (boolean) - Whether to display the bathroom count.
- **show_unit_area** (boolean) - Whether to display the unit area.
- **provider_id** (string) - The PMS-side floor plan ID. Unique within the asset.
- **provider_group_id** (string) - The PMS-side floor plan group ID.
- **image_url** (string) - URL for the primary floor plan image.
- **secondary_image_url** (string) - URL for a secondary floor plan image.
- **updated_at** (string) - Timestamp of the last update.
- **created_at** (string) - Timestamp of creation.
### Response Example
```json
{
"data": [
{
"id": "133265",
"asset_id": "7778",
"name": "B1",
"filter_label": "B1",
"bedroom_count": 2,
"bathroom_count": 2,
"show_bedroom_count": true,
"show_bathroom_count": true,
"show_unit_area": true,
"provider_id": null,
"provider_group_id": null,
"image_url": "https://cdn.sightmap.com/assets/e8/yw/e8ywk1eqplx/94/a4/94a4cfeed2a283563fedca6803f12df6.jpg",
"secondary_image_url": "https://cdn.sightmap.com/assets/e8/yw/e8ywk1eqplx/3a/4f/3a4fae12b128e721bcc72295f4c5bd7a.jpg",
"updated_at": "2024-07-18T16:18:41+00:00",
"created_at": "2020-11-09T15:58:33+00:00"
}
]
}
```
```
--------------------------------
### List Floor Plan Expense Entries
Source: https://developers.sightmap.com/docs/accessing-expenses-by-property-floor-plan-and-unit
After retrieving floor plan expenses, use this endpoint to get a list of units associated with each expense and their respective amounts. Key fields to note are 'expense_id' and 'floor_plan_id'.
```json
"data": [
{
"asset_id": "7778",
"expense_id": "348",
"floor_plan_id": "133265",
"amount": "500.00"
},
{
"asset_id": "7778",
"expense_id": "348",
"floor_plan_id": "133266",
"amount": "300.00"
},
{
"asset_id": "7778",
"expense_id": "348",
"floor_plan_id": "133267",
"amount": "500.00"
},
{
"asset_id": "7778",
"expense_id": "348",
"floor_plan_id": "141274",
"amount": "700.00"
},
```
--------------------------------
### `ready` event
Source: https://developers.sightmap.com/docs/sightmap-javascript-iframe-api
The `ready` event fires when the embed has loaded sufficiently to accept API input or user interaction.
```APIDOC
## `ready` event
### Description
The `ready` event fires when the embed has loaded enough to allow for API input and/or user interaction.
### Usage Example
```javascript
embed.on('ready', function () {
console.log('The embed is ready.')
});
```
```
--------------------------------
### SightMap in WordPress FancyBox
Source: https://developers.sightmap.com/docs/adding-sightmap-as-a-pop-up-iframe
This example shows how to embed a SightMap in a WordPress page using the FancyBox modal package. It utilizes an iframe for integration.
```html
```
--------------------------------
### Listen for Embed Ready Event
Source: https://developers.sightmap.com/docs/sightmap-javascript-iframe-api
Use the `ready` event to execute code once the embed has loaded and is ready for API input or user interaction.
```javascript
embed.on('ready', function () {
console.log('The embed is ready.')
});
```
--------------------------------
### Check Transaction Status
Source: https://developers.sightmap.com/docs/pushing-pricing-data-to-sightmap
Retrieve the status of a transaction using a GET request to the transaction endpoint. This helps monitor completion or identify expirations.
```url
https://api.sightmap.com/v1/assets/{asset}/multifamily/pricing/{process}/transactions/{transaction}
```
--------------------------------
### Get Unit IDs
Source: https://developers.sightmap.com/docs/sightmap-javascript-iframe-api
Retrieves a list of all unit IDs currently displayed on the map. This method uses a callback function to return the array of unit IDs.
```javascript
embed.getUnitIds(function (unitIds) {
console.log('Unit IDs:', unitIds);
});
```
--------------------------------
### Open a Transaction
Source: https://developers.sightmap.com/docs/pushing-pricing-data-to-sightmap
Initiate a new transaction by sending a POST request to the ingest URL with `commit=0`. This keeps the transaction open for subsequent requests.
```url
https://api.sightmap.com/v1/assets/{asset}/multifamily/pricing/{process}/ingest?commit=0
```
--------------------------------
### Transaction Status Response
Source: https://developers.sightmap.com/docs/pushing-pricing-data-to-sightmap
A successful GET request to check transaction status returns a JSON object detailing the transaction's ID, status, and data counts.
```json
{
"id": "15196498",
"uuid": "44daf2ca-ba0a-4fe8-8ce6-141b23dd2185",
"asset_id": "1323",
"process_id": "5803",
"pricing_strategy": "flat_pricing",
"status": "finished",
"source_count": 1,
"expires_in": null,
"created_at": "2022-04-21T19:02:51+00:00",
"queued_at": "2022-04-21T19:02:51+00:00",
"started_at": "2022-04-21T19:02:58+00:00",
"ended_at": "2022-04-21T19:02:58+00:00"
}
```
--------------------------------
### Get Map View
Source: https://developers.sightmap.com/docs/sightmap-javascript-iframe-api
Retrieves the currently active map view selection. The result is returned via a callback function, providing an object with a 'type' property indicating the view.
```javascript
embed.getMapView(function (mapView) {
console.log('Active map view:', mapView.type);
});
```
--------------------------------
### Initialize SightMap API with Event Listener
Source: https://developers.sightmap.com/docs/integration-faq
Wrap SightMap API initialization code in a 'DOMContentLoaded' event listener to ensure the bot loads before the script executes. This is crucial for CRM bot integrations.
```javascript
document.addEventListener("DOMContentLoaded", function(event) {
// Create a new embed instance, providing the IFrame id value:
var embed = new SightMap.Embed('sightmap');
embed.on('outbound.{{key}}.click', function(event) {
// bot usage code goes here
})
});
```
--------------------------------
### Disable UI Elements
Source: https://developers.sightmap.com/docs/sightmap-javascript-iframe-api
Example of using the disableUI call to disable specific UI elements within the SightMap embed. Note that maps in JSFiddles are scaled and will be larger on an actual website.
```html
```
--------------------------------
### SightMap Using FancyBox Modal
Source: https://developers.sightmap.com/docs/adding-sightmap-as-a-pop-up-iframe
Embed SightMap within a FancyBox modal window using a simple anchor tag. Note that the map size in the example may be scaled down for the window.
```html
```
--------------------------------
### List Unit Expenses for an Asset
Source: https://developers.sightmap.com/docs/accessing-expenses-by-property-floor-plan-and-unit
Use the GET: List unit expenses endpoint to retrieve all unit-level expenses for a given asset. This provides a foundational list of expenses associated with the property.
```json
"data": [
{
"id": "345258",
"asset_id": "7778",
"label": "Pest Control",
"disclaimer": null,
"provider_id": null,
"provider_group": null,
"provider_code": null,
"provider_method": null,
"provider_references": null,
"tooltip_label": null,
"type": "pest_control",
"category": "services",
"group": "utilities",
"frequency": "monthly",
"due_at_timing": null,
"limit": 1,
"proration_method": null,
"value_cap_type": null,
"value_cap": null,
"percentage_value_cap": null,
"value_type": "amount",
"is_enabled": true,
"is_required": true,
"is_refundable": false,
"is_taxable": false,
"is_included": false,
"is_third_party": false,
"is_per_applicant": false,
"is_situational": false,
"created_at": "2025-12-17T00:42:41+00:00",
"updated_at": "2025-12-17T00:42:41+00:00"
}
]
}
```
--------------------------------
### metrics.unitDetails.apply.click
Source: https://developers.sightmap.com/docs/sightmap-metrics-api
Fired when a user selects the 'Apply' call-to-action within the unit details modal. Includes unit details, lease term, and move-in date.
```APIDOC
## metrics.unitDetails.apply.click
### Description
Fired when a user selects the 'Apply' call-to-action within the unit details modal.
### Event Payload
```json
{
name: "metrics.unitDetails.apply.click",
data: {
unit: {
id: "string",
mapId: "string", // deprecated, use `id` instead
unitNumber: "string",
area: "integer",
areaDisplay: "string",
price: "integer", // nullable
priceDisplay: "string", // nullable
availableOn: "string", // nullable
availableOnDisplay: "string", // nullable
floor: {
id: "string",
filterLabel: "string",
filterShortLabel: "string"
},
floorPlan: {
id: "string",
name: "string",
bedroomCount: "integer",
bathroomCount: "integer"
}
},
leaseTerm: "integer", // nullable
moveInDate: "string",
applyUrl: "string"
}
}
```
### Usage Example
```javascript
embed.on('metrics.unitDetails.apply.click', function (event) {
console.log(event);
});
```
```
--------------------------------
### List Unit Reference Groups
Source: https://developers.sightmap.com/docs/pulling-unit-floor-plan-data
This endpoint retrieves a list of PMS integrations that have reference codes associated with a given asset. It's the first step in a two-call process to get unit references.
```APIDOC
## GET: List groups
### Description
Retrieves a list of PMS integrations that have reference codes on the specified asset.
### Method
GET
### Endpoint
/v1/assets/{asset_id}/multifamily/units/reference-groups
### Parameters
#### Path Parameters
- **asset_id** (string) - Required - The unique identifier of the asset.
### Response
#### Success Response (200)
- **data** (array) - Contains a list of reference group objects.
- **id** (string) - The unique identifier of the reference group.
- **asset_id** (string) - The identifier of the asset the group belongs to.
- **name** (string) - The name of the reference group.
- **description** (string) - A description of the reference group.
- **key** (string) - A unique key for the PMS integration.
- **created_at** (string) - Timestamp of when the group was created.
- **updated_at** (string) - Timestamp of when the group was last updated.
### Response Example
```json
{
"data": [
{
"id": "39275",
"asset_id": "7778",
"name": "[SALES DEMO] The Milo - Garden",
"description": "Sample Yardi Rentcafe Data",
"key": "yardi-rentcafe",
"created_at": "2026-04-16T03:27:09+00:00",
"updated_at": "2026-04-16T03:27:09+00:00"
}
]
}
```
```
--------------------------------
### metrics.calculator.impression
Source: https://developers.sightmap.com/docs/sightmap-metrics-api
Fired when the calculator modal first renders. Includes details of the unit associated with the calculator.
```APIDOC
## metrics.calculator.impression
### Description
Fired when the calculator modal first renders.
### Event Payload
```json
{
"name": "metrics.calculator.impression",
"data": {
"unit": {
"id": "string",
"unitNumber": "string",
"unitNumberDisplay": "string",
"area": "integer",
"areaDisplay": "string",
"price": "integer",
"priceDisplay": "string",
"availableOn": "string",
"availableOnDisplay": "string",
"floor": {
"id": "string",
"filterLabel": "string",
"filterShortLabel": "string"
},
"floorPlan": {
"id": "string",
"name": "string",
"bedroomCount": "integer",
"bathroomCount": "integer"
}
}
}
}
```
### Usage Example
```javascript
embed.on('metrics.calculator.impression', function (event) {
console.log(event);
});
```
```
--------------------------------
### Listen for metrics.calculator.apply.click Event
Source: https://developers.sightmap.com/docs/sightmap-metrics-api
This JavaScript code allows you to subscribe to the 'metrics.calculator.apply.click' event and process the incoming event data.
```javascript
embed.on('metrics.calculator.apply.click', function (event) {
console.log(event);
});
```
--------------------------------
### metrics.calculator.apply.click
Source: https://developers.sightmap.com/docs/sightmap-metrics-api
Fired when a user selects the 'Apply' call-to-action within the calculator modal.
```APIDOC
## metrics.calculator.apply.click
### Description
Fired when a user selects the 'Apply' call-to-action within the calculator modal.
### Event Payload
```json
{
"name": "metrics.calculator.apply.click",
"data": {
"unit": {
"id": "2",
"unitNumber": "102",
"unitNumberDisplay": "UNIT 102",
"area": 650,
"areaDisplay": "650 sq. ft.",
"price": 400,
"priceDisplay": "$400.00",
"availableOn": "2025-05-08",
"availableOnDisplay": "Available May 8",
"floor": {
"id": "1",
"filterLabel": "Floor 1",
"filterShortLabel": "1"
},
"floorPlan": {
"id": "3",
"name": "B1",
"bedroomCount": 2,
"bathroomCount": 2
}
},
"leaseTerm": 12,
"applyUrl": "https://example.com/v2?SearchUrl=https%3A%2F%2Fexample.com%2Fv2%2Fsearch&MoveInDate=2025-05-08&UnitId=2&LeaseTerm=12",
"applyLabel": "Apply",
"moveInDate": "2025-05-08"
}
}
```
### Usage Example
```javascript
embed.on('metrics.calculator.apply.click', function (event) {
console.log(event);
});
```
```
--------------------------------
### List Asset Expenses
Source: https://developers.sightmap.com/docs/accessing-expenses-by-property-floor-plan-and-unit
Use the `GET: List asset expenses` endpoint to retrieve all asset-level expenses and their associated values. The expense details, including `value_type` and `value`, are directly available in the response object.
```APIDOC
## GET: List asset expenses
### Description
Retrieves a list of all expenses associated with a specific asset, including their values and types.
### Method
GET
### Endpoint
/v1/assets/{assetId}/expenses
### Parameters
#### Path Parameters
- **assetId** (string) - Required - The unique identifier of the asset.
### Response
#### Success Response (200)
- **data** (array) - An array of expense objects.
- **id** (string) - The unique identifier of the expense.
- **asset_id** (string) - The ID of the asset the expense belongs to.
- **label** (string) - A human-readable label for the expense.
- **type** (string) - The type of the expense (e.g., "renters_insurance", "government").
- **category** (string) - The category the expense falls under (e.g., "administrative").
- **group** (string) - The group the expense belongs to (e.g., "insurance", "contracting").
- **frequency** (string) - How often the expense occurs (e.g., "annually").
- **value_type** (string) - The type of value the expense has (e.g., "amount").
- **amount** (string) - The monetary value of the expense.
- **is_enabled** (boolean) - Indicates if the expense is currently enabled.
- **is_required** (boolean) - Indicates if the expense is mandatory.
- **is_refundable** (boolean) - Indicates if the expense is refundable.
- **is_taxable** (boolean) - Indicates if the expense is taxable.
- **is_included** (boolean) - Indicates if the expense is included in a package.
- **is_third_party** (boolean) - Indicates if the expense is paid to a third party.
- **is_per_applicant** (boolean) - Indicates if the expense is charged per applicant.
- **is_situational** (boolean) - Indicates if the expense is situational.
- **created_at** (string) - The timestamp when the expense was created.
- **updated_at** (string) - The timestamp when the expense was last updated.
### Response Example
```json
{
"data": [
{
"id": "327",
"asset_id": "7778",
"label": "Renters Insurance",
"disclaimer": null,
"provider_id": null,
"provider_group": null,
"provider_code": "7620",
"provider_method": null,
"provider_references": null,
"tooltip_label": null,
"type": "renters_insurance",
"category": "administrative",
"group": "insurance",
"frequency": "annually",
"due_at_timing": "move_in",
"limit": 1,
"proration_method": null,
"value_cap_type": "amount",
"value_cap": "250.00",
"percentage_value_cap": null,
"value_type": "amount",
"amount": "175.00",
"is_enabled": true,
"is_required": true,
"is_refundable": false,
"is_taxable": false,
"is_included": false,
"is_third_party": true,
"is_per_applicant": false,
"is_situational": false,
"created_at": "2025-01-14T16:09:28+00:00",
"updated_at": "2025-10-28T17:01:51+00:00"
}
]
}
```
```
--------------------------------
### Handle Apply Button Clicks in Unit Details
Source: https://developers.sightmap.com/docs/sightmap-metrics-api
Listen for clicks on the 'Apply' call-to-action within the unit details modal. This event provides details about the unit and the application parameters.
```javascript
embed.on('metrics.unitDetails.apply.click', function (event) {
console.log(event);
});
```
--------------------------------
### Basic SightMap IFrame API Integration
Source: https://developers.sightmap.com/docs/sightmap-javascript-iframe-api
This HTML document demonstrates a basic integration of the SightMap JavaScript IFrame API. Ensure the `origin` parameter in the iframe `src` matches your served origin and that the page is served from an origin (not opened directly).
```html
SightMap JavaScript IFrame API Example
```
--------------------------------
### List Asset Expenses
Source: https://developers.sightmap.com/docs/accessing-expenses-by-property-floor-plan-and-unit
Use the GET: List asset expenses endpoint to retrieve all asset-level expenses and their associated values. The expense details, including 'value_type' and 'value', are directly available on the expense object.
```json
"data": [
{
"id": "327",
"asset_id": "7778",
"label": "Renters Insurance",
"disclaimer": null,
"provider_id": null,
"provider_group": null,
"provider_code": "7620",
"provider_method": null,
"provider_references": null,
"tooltip_label": null,
"type": "renters_insurance",
"category": "administrative",
"group": "insurance",
"frequency": "annually",
"due_at_timing": "move_in",
"limit": 1,
"proration_method": null,
"value_cap_type": "amount",
"value_cap": "250.00",
"percentage_value_cap": null,
"value_type": "amount",
"amount": "175.00",
"is_enabled": true,
"is_required": true,
"is_refundable": false,
"is_taxable": false,
"is_included": false,
"is_third_party": true,
"is_per_applicant": false,
"is_situational": false,
"created_at": "2025-01-14T16:09:28+00:00",
"updated_at": "2025-10-28T17:01:51+00:00"
},
{
"id": "328",
"asset_id": "7778",
"label": "Gov Fee (138)",
"disclaimer": null,
"provider_id": null,
"provider_group": null,
"provider_code": "3140",
"provider_method": null,
"provider_references": null,
"tooltip_label": null,
"type": "government",
"category": "administrative",
"group": "contracting",
"frequency": "annually",
"due_at_timing": "move_in",
"limit": 1,
"proration_method": null,
"value_cap_type": null,
"value_cap": null,
"percentage_value_cap": null,
"value_type": "amount",
"amount": "10.23",
"is_enabled": false,
"is_required": true,
"is_refundable": false,
"is_taxable": true,
"is_included": false,
"is_third_party": false,
"is_per_applicant": false,
"is_situational": false,
"created_at": "2025-01-14T16:09:28+00:00",
"updated_at": "2025-01-14T16:25:04+00:00"
},
```
--------------------------------
### Listen for metrics.calculator.expense.click Event
Source: https://developers.sightmap.com/docs/sightmap-metrics-api
Use this JavaScript snippet to listen for the 'metrics.calculator.expense.click' event and log the event data.
```javascript
embed.on('metrics.calculator.expense.click', function (event) {
console.log(event);
});
```
--------------------------------
### Listen for metrics.unitMatches.impression Event
Source: https://developers.sightmap.com/docs/sightmap-metrics-api
This JavaScript code snippet demonstrates how to listen for the 'metrics.unitMatches.impression' event using the embed object and log the event data to the console.
```javascript
embed.on('metrics.unitMatches.impression', function (event) {
console.log(event);
});
```
--------------------------------
### Set Active Floor with setFloor
Source: https://developers.sightmap.com/docs/sightmap-javascript-iframe-api
Use the `setFloor` method to programmatically change the active floor in SightMap. Provide the unique ID of the floor you wish to activate.
```javascript
// Set the active floor to the 2nd floor, which has an ID of `4731`:
embed.setFloor('4731');
```
--------------------------------
### metrics.unitList.impression
Source: https://developers.sightmap.com/docs/sightmap-metrics-api
This event is fired when the unit list is first rendered. It provides details about the units displayed.
```APIDOC
## metrics.unitList.impression
### Description
Fired when the unit list is first rendered.
### Event Payload
```json
{
name: "metrics.unitList.impression",
data: {
units: [
{
id: "string",
mapId: "string",
unitNumber: "string",
area: "number",
areaDisplay: "string",
price: "number | null",
priceDisplay: "string | null",
availableOn: "string | null",
availableOnDisplay: "string | null",
floor: {
id: "string",
filterLabel: "string",
filterShortLabel: "string"
},
floorPlan: {
id: "string",
name: "string",
bedroomCount: "number",
bathroomCount: "number"
}
}
]
}
}
```
### Usage Example
```javascript
embed.on('metrics.unitList.impression', function (event) {
console.log(event);
});
```
```