# Search Properties — Melo

> Searches properties in Melo. See the documentation

- Key: `melo-search-properties`
- Type: Action (Read-only)
- Version: 0.0.2
- App: Melo (`melo`) — https://pipedream.com/apps/melo.md
- This page (HTML): https://pipedream.com/apps/melo/actions/search-properties
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/melo/actions/search-properties/search-properties.mjs

## Description

Searches properties in Melo. [See the documentation](https://docs.melo.io/api-reference/endpoint/properties/get_collection)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `bedroomMax` | `integer` | No | Maximum number of bedrooms in the property. |
| `bedroomMin` | `integer` | No | Minimum number of bedrooms in the property. |
| `budgetMax` | `integer` | No | Maximum budget for the property. |
| `budgetMin` | `integer` | No | Minimum budget for the property. |
| `condominiumFeesMax` | `integer` | No | Maximum condominium fees for the property. |
| `condominiumFeesMin` | `integer` | No | Minimum condominium fees for the property. |
| `constructionYearMax` | `integer` | No | Maximum construction year of the property. |
| `constructionYearMin` | `integer` | No | Minimum construction year of the property. |
| `energyCategories` | `string[]` | No | The energy efficiency categories of the property. |
| `energyValueMax` | `integer` | No | Maximum energy value of the property. |
| `energyValueMin` | `integer` | No | Minimum energy value of the property. |
| `eventPriceVariationFromCreatedAt` | `string` | No | Date from which an event of type price is created — inclusive. |
| `eventPriceVariationMax` | `integer` | No | Maximum percent variation of an event of type price. |
| `eventPriceVariationMin` | `integer` | No | Minimum percent variation of an event of type price. |
| `eventPriceVariationToCreatedAt` | `string` | No | Date before which an event of type price is created — inclusive. |
| `eventSurfaceVariationFromCreatedAt` | `string` | No | Date from which an event of type surface is created — inclusive. |
| `eventSurfaceVariationMax` | `integer` | No | Maximum percent variation of an event of type surface. |
| `eventSurfaceVariationMin` | `integer` | No | Minimum percent variation of an event of type surface. |
| `eventSurfaceVariationToCreatedAt` | `string` | No | Date before which an event of type surface is created — inclusive. |
| `excludedCities` | `string[]` | No | Cities to be excluded. |
| `excludedInseeCodes` | `string[]` | No | Insee codes to be excluded. |
| `excludedProperties` | `string[]` | No | Properties to be excluded. |
| `excludedZipcodes` | `string[]` | No | Zipcodes to be excluded. |
| `expired` | `boolean` | No | Whether to show properties that are expired. A property is considered expired when all its adverts are expired. Can be true, false or null. Default is null which returns all properties no matter if they’re expired or not. |
| `feesPercentageMax` | `integer` | No | Maximum percentage of fees. |
| `feesPercentageMin` | `integer` | No | Minimum percentage of fees. |
| `feesResponsibility` | `string` | No | Responsibility for fees. 0 for seller, 1 for buyer. |
| `floorQuantityMax` | `integer` | No | Maximum number of floors in the property. |
| `floorQuantityMin` | `integer` | No | Minimum number of floors in the property. |
| `fromDate` | `string` | No | Date from which the property is created — inclusive. |
| `fromUpdatedAt` | `string` | No | Date from which the property is updated — inclusive. |
| `furnished` | `boolean` | No | Filter for furnished properties. |
| `greenHouseGasCategories` | `string[]` | No | Green house gas performance letter array of the property. |
| `greenHouseGasValueMax` | `integer` | No | Maximum value of green house gas of the property. |
| `greenHouseGasValueMin` | `integer` | No | Minimum value of green house gas of the property. |
| `includedCities` | `string[]` | No | Located in given cities. |
| `includedDepartments` | `string[]` | No | Located in given departments. |
| `includedInseeCodes` | `string[]` | No | Located in given insee codes. |
| `includedZipcodes` | `string[]` | No | Located in given zipcodes. |
| `inventoryPriceMax` | `integer` | No | Lower than or equal to given inventory price. |
| `inventoryPriceMin` | `integer` | No | Greater than or equal to given inventory price. |
| `lat` | `string` | No | Latitude. Will work if latitude exists in the property. |
| `lon` | `string` | No | Longitude. Will work if longitude exists in the property. |
| `lotCountMax` | `integer` | No | Lower than or equal to given lot count. |
| `lotCountMin` | `integer` | No | Greater than or equal to given lot count. |
| `orderCreatedAt` | `string` | No | Order properties by creation date. Can be asc or desc. |
| `orderUpdatedAt` | `string` | No | Order properties by update date. Can be asc or desc. |
| `priceExcludingFeesMax` | `integer` | No | Lower than or equal to given price excluding fees. |
| `priceExcludingFeesMin` | `integer` | No | Greater than or equal to given price excluding fees. |
| `pricePerMeterMax` | `integer` | No | Lower than or equal to given price per meter. |
| `pricePerMeterMin` | `integer` | No | Greater than or equal to given price per meter. |
| `propertyTypes` | `string[]` | No | Type of property. Apartment 0, House 1, Building 2, Parking 3, Office 4, Land 5, Shop 6. |
| `publisherTypes` | `string[]` | No | Type of publisher. Individual 0, Professional 1. |
| `radius` | `integer` | No | Distance expressed in kilometers. Will work if latitude & longitude parameters are also set. |
| `rentalChargesMax` | `integer` | No | Lower than or equal to given rental charges amount. |
| `rentalChargesMin` | `integer` | No | Greater than or equal to given rental charges amount. |
| `rentalPledgeMax` | `integer` | No | Lower than or equal to given rental pledge amount. |
| `rentalPledgeMin` | `integer` | No | Greater than or equal to given rental pledge amount. |
| `renterFeesMax` | `integer` | No | Lower than or equal to given renter fees. |
| `renterFeesMin` | `integer` | No | Greater than or equal to given renter fees. |
| `roomMax` | `integer` | No | Maximum rooms of the property. |
| `roomMin` | `integer` | No | Minimum rooms of the property. |
| `surfaceMax` | `integer` | No | Lower than or equal to given surface. |
| `surfaceMin` | `integer` | No | Greater than or equal to given surface. |
| `toDate` | `string` | No | To datetime — inclusive. |
| `toUpdatedAt` | `string` | No | Since datetime — inclusive. |
| `transactionType` | `integer` | No | Type of transaction. Sell 0, Rent 1. |
| `withCoherentPrice` | `boolean` | No | Filter properties with coherent price. |
| `withVirtualTour` | `boolean` | No | Having a virtual tour video link. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "melo",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "melo-search-properties",
  arguments: {
    bedroomMax: 10,
    bedroomMin: 10,
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "melo-search-properties",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    melo: { authProvisionId: "apn_xxxxxxx" },
    bedroomMax: 10,
    bedroomMin: 10,
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "melo-search-properties",
    "configured_props": {
      "melo": { "authProvisionId": "apn_xxxxxxx" },
      "bedroomMax": 10,
      "bedroomMin": 10
    }
  }'
```

---

- App: https://pipedream.com/apps/melo.md · All apps: https://pipedream.com/apps
