> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.pricelabs.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.pricelabs.co/_mcp/server.

# Get compsets for a Market Dashboard report

GET https://api.pricelabs.co/v1/neighborhood_data/get_md_compsets

Returns the compsets available on a Market Dashboard report, for use as `md_compset` when
assigning `MD` as a listing's neighborhood data source.

Each compset carries three fields, and the distinction matters:
  * `value` — the identifier. This is the only form
    `POST /v1/neighborhood_data/update_source` accepts as `md_compset`. Send it verbatim.
  * `label` — display text. Not a valid `md_compset`.
  * `group` — a heading for grouping compsets in a UI.

Get `md_id` from `md_reports` in `GET /v1/neighborhood_data/fetch_sources`.


Reference: https://developers.pricelabs.co/customer-api/api-reference/customer-api/neighborhood-data/get-md-report-compsets

## Request

### Query parameters

- `listing_id` (string, required)
- `pms` (string, required)
- `md_id` (integer, required) — Market Dashboard report id, from `md_reports` in `fetch_sources`.

### Headers

- `X-API-Key` (string, required) — API key for Customer API authentication.

## Response

### 200

Success

- `data` (V1NeighborhoodDataGetMdCompsetsGetResponsesContentApplicationJsonSchemaData, optional)
- `status` (string, optional)

## Errors

### 400 Bad Request Error

Missing `listing_id`, `pms` or `md_id`

- `error` (string, optional)
- `status` (string, optional)

### 404 Not Found Error

Listing not found in this account

- `error` (string, optional)
- `status` (string, optional)

## Types

### V1NeighborhoodDataGetMdCompsetsGetResponsesContentApplicationJsonSchemaData

- `md_id` (string, optional)
- `compsets` (list of V1NeighborhoodDataGetMdCompsetsGetResponsesContentApplicationJsonSchemaDataCompsetsItems, optional)
- `listing_id` (string, optional)
- `pms` (string, optional)

### V1NeighborhoodDataGetMdCompsetsGetResponsesContentApplicationJsonSchemaDataCompsetsItems

- `value` (string, optional) — Pass this as `md_compset`.
- `label` (string, optional) — Display text. Not a valid `md_compset`.
- `group` (string, optional)

## Examples

**Response**

```json
{
  "data": {
    "md_id": "98979",
    "compsets": [
      {
        "value": "ABB: All Bedrooms",
        "label": "Airbnb: All Bedrooms (6229 listings)",
        "group": "Whole Market Compsets"
      },
      {
        "value": "VRBO: All Bedrooms",
        "label": "Vrbo: All Bedrooms (4694 listings)",
        "group": "Whole Market Compsets"
      },
      {
        "value": "ABB Comp: One Snowmass Airbnb",
        "label": "Airbnb: One Snowmass Airbnb (3 listings)",
        "group": "Custom Compsets"
      }
    ],
    "listing_id": "SUNSETPROPS_OLSE___239",
    "pms": "vrm"
  },
  "status": "Success"
}
```

**SDK Code**

```python Neighborhood Data_getMdReportCompsets_example
import requests

url = "https://api.pricelabs.co/v1/neighborhood_data/get_md_compsets"

querystring = {"listing_id":"SUNSETPROPS_OLSE___239","pms":"vrm","md_id":"98979"}

headers = {"X-API-Key": "{{API_KEY}}"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Neighborhood Data_getMdReportCompsets_example
const url = 'https://api.pricelabs.co/v1/neighborhood_data/get_md_compsets?listing_id=SUNSETPROPS_OLSE___239&pms=vrm&md_id=98979';
const options = {method: 'GET', headers: {'X-API-Key': '{{API_KEY}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Neighborhood Data_getMdReportCompsets_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.pricelabs.co/v1/neighborhood_data/get_md_compsets?listing_id=SUNSETPROPS_OLSE___239&pms=vrm&md_id=98979"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-Key", "{{API_KEY}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Neighborhood Data_getMdReportCompsets_example
require 'uri'
require 'net/http'

url = URI("https://api.pricelabs.co/v1/neighborhood_data/get_md_compsets?listing_id=SUNSETPROPS_OLSE___239&pms=vrm&md_id=98979")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '{{API_KEY}}'

response = http.request(request)
puts response.read_body
```

```java Neighborhood Data_getMdReportCompsets_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.pricelabs.co/v1/neighborhood_data/get_md_compsets?listing_id=SUNSETPROPS_OLSE___239&pms=vrm&md_id=98979")
  .header("X-API-Key", "{{API_KEY}}")
  .asString();
```

```php Neighborhood Data_getMdReportCompsets_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.pricelabs.co/v1/neighborhood_data/get_md_compsets?listing_id=SUNSETPROPS_OLSE___239&pms=vrm&md_id=98979', [
  'headers' => [
    'X-API-Key' => '{{API_KEY}}',
  ],
]);

echo $response->getBody();
```

```csharp Neighborhood Data_getMdReportCompsets_example
using RestSharp;

var client = new RestClient("https://api.pricelabs.co/v1/neighborhood_data/get_md_compsets?listing_id=SUNSETPROPS_OLSE___239&pms=vrm&md_id=98979");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "{{API_KEY}}");
IRestResponse response = client.Execute(request);
```

```swift Neighborhood Data_getMdReportCompsets_example
import Foundation

let headers = ["X-API-Key": "{{API_KEY}}"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.pricelabs.co/v1/neighborhood_data/get_md_compsets?listing_id=SUNSETPROPS_OLSE___239&pms=vrm&md_id=98979")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```