# /midland/transactions

`POST /api/midland/transactions`

Price: 1 credit

Get one Hong Kong property deal recorded by Midland Realty by its transaction id (or transaction URL), together with the full price history of the same unit. Returns the transacted price and price per saleable area, gross and saleable area, room counts, floor, floor band, flat and orientation, unit features and floor plans, the eight-level geography, the estate profile (vendor, address, block count, occupation date, coordinates, school nets, facilities, photos and videos), the building, and every earlier deal on the same unit with its price, date, prior price and gain.

## How to use it

Get a single Hong Kong property deal by transaction id (e.g. 'F20260700101'); a full transaction URL is also accepted. Set lang / unit / currency for the output locale. The history field lists every earlier recorded deal on the same flat with prices, dates and gains — this is the price history of that unit. Find ids with midland/transactions/search.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `lang` (string) — Output language. Districts, estates, buildings and feature names are all translated. (default: "zh-hk"; one of: "zh-hk", "zh-cn", "en")
- `unit` (string) — Area unit used for areas and per-area prices. (default: "feet"; one of: "feet", "meter")
- `currency` (string) — Currency used for prices, rents and monthly payments. (default: "HKD"; one of: "HKD", "CNY")
- `transaction` (string, required) — Midland transaction id, or the full transaction URL. (examples: "F20260700101", "323084")

## Response

### 200 — Successful Response

- `@type` (string) (default: "MidlandTransaction")
- `id` (string, required)
- `url` (string, nullable)
- `url_zh_cn` (string, nullable)
- `url_en` (string, nullable)
- `transaction_type` (string, nullable)
- `transaction_at` (integer, nullable)
- `market_type` (string, nullable)
- `deal_type` (string, nullable)
- `source` (string, nullable)
- `original_source` (string, nullable)
- `tags` (array) (default: [])
- `price` (number, nullable)
- `price_per_net_area` (number, nullable)
- `area` (number, nullable)
- `net_area` (number, nullable)
- `bedroom_count` (integer, nullable)
- `sitting_room_count` (integer, nullable)
- `floor` (string, nullable)
- `floor_level` (object, nullable)
  - `@type` (string) (default: "MidlandRef")
  - `id` (string, nullable)
  - `name` (string, nullable)
- `flat` (string, nullable)
- `orientation` (string, nullable)
- `geo` (object, nullable)
  - `@type` (string) (default: "MidlandGeo")
  - `region` (object, nullable)
    - `@type` (string) (default: "MidlandRef")
    - `id` (string, nullable)
    - `name` (string, nullable)
  - `subregion` (object, nullable)
    - `@type` (string) (default: "MidlandRef")
    - `id` (string, nullable)
    - `name` (string, nullable)
  - `district` (object, nullable)
    - `@type` (string) (default: "MidlandRef")
    - `id` (string, nullable)
    - `name` (string, nullable)
  - `sm_district` (object, nullable)
    - `@type` (string) (default: "MidlandRef")
    - `id` (string, nullable)
    - `name` (string, nullable)
  - `combined_district` (object, nullable)
    - `@type` (string) (default: "MidlandRef")
    - `id` (string, nullable)
    - `name` (string, nullable)
  - `int_district` (object, nullable)
    - `@type` (string) (default: "MidlandRef")
    - `id` (string, nullable)
    - `name` (string, nullable)
  - `int_sm_district` (object, nullable)
    - `@type` (string) (default: "MidlandRef")
    - `id` (string, nullable)
    - `name` (string, nullable)
  - `lux_district` (object, nullable)
    - `@type` (string) (default: "MidlandRef")
    - `id` (string, nullable)
    - `name` (string, nullable)
- `estate` (object, nullable)
  - `@type` (string) (default: "MidlandTransactionEstate")
  - `id` (string, nullable)
  - `name` (string, nullable)
  - `address` (string, nullable)
  - `vendor` (string, nullable)
  - `block_count_text` (string, nullable)
  - `first_op_at` (integer, nullable)
  - `latitude` (number, nullable)
  - `longitude` (number, nullable)
  - `school_net` (object, nullable)
    - `@type` (string) (default: "MidlandSchoolNet")
    - `kindergarten_id` (string, nullable)
    - `kindergarten_name` (string, nullable)
    - `primary_id` (string, nullable)
    - `primary_name` (string, nullable)
    - `secondary_id` (string, nullable)
    - `secondary_name` (string, nullable)
  - `facility_groups` (array) (default: [])
    - `@type` (string) (default: "MidlandRef")
    - `id` (string, nullable)
    - `name` (string, nullable)
  - `property_status` (array) (default: [])
  - `photos` (array) (default: [])
  - `videos` (array) (default: [])
    - `@type` (string) (default: "MidlandPropertyVideo")
    - `id` (string, nullable)
    - `url` (string, nullable)
    - `stream_url` (string, nullable)
    - `thumbnail` (string, nullable)
  - `url` (string, nullable)
- `building` (object, nullable)
  - `@type` (string) (default: "MidlandBuilding")
  - `id` (string, nullable)
  - `name` (string, nullable)
  - `address` (string, nullable)
  - `first_op_at` (integer, nullable)
  - `floor_count` (integer, nullable)
  - `building_type` (string, nullable)
  - `latitude` (number, nullable)
  - `longitude` (number, nullable)
  - `streetview_latitude` (number, nullable)
  - `streetview_longitude` (number, nullable)
  - `streetview_angle` (integer, nullable)
- `features` (array) (default: [])
  - `@type` (string) (default: "MidlandRef")
  - `id` (string, nullable)
  - `name` (string, nullable)
- `floor_plans` (array) (default: [])
  - `@type` (string) (default: "MidlandFloorPlan")
  - `id` (string, nullable)
  - `name` (string, nullable)
  - `url` (string, nullable)
  - `source` (string, nullable)
  - `phase_id` (string, nullable)
  - `phase_name` (string, nullable)
  - `building_id` (string, nullable)
  - `building_name` (string, nullable)
  - `floor_from` (string, nullable)
  - `floor_to` (string, nullable)
  - `floor_text` (string, nullable)
- `images` (array) (default: [])
- `history` (array) (default: [])
  - `@type` (string) (default: "MidlandTransactionHistoryEntry")
  - `id` (string, nullable)
  - `transaction_at` (integer, nullable)
  - `transaction_type` (string, nullable)
  - `market_type` (string, nullable)
  - `price` (number, nullable)
  - `area` (number, nullable)
  - `net_area` (number, nullable)
  - `previous_price` (number, nullable)
  - `previous_transaction_at` (integer, nullable)
  - `gain_percent` (number, nullable)
  - `bedroom_count` (integer, nullable)
  - `sitting_room_count` (integer, nullable)
  - `floor` (string, nullable)
  - `flat` (string, nullable)
  - `estate` (object, nullable)
    - `@type` (string) (default: "MidlandRef")
    - `id` (string, nullable)
    - `name` (string, nullable)
  - `building` (object, nullable)
    - `@type` (string) (default: "MidlandBuilding")
    - `id` (string, nullable)
    - `name` (string, nullable)
    - `address` (string, nullable)
    - `first_op_at` (integer, nullable)
    - `floor_count` (integer, nullable)
    - `building_type` (string, nullable)
    - `latitude` (number, nullable)
    - `longitude` (number, nullable)
    - `streetview_latitude` (number, nullable)
    - `streetview_longitude` (number, nullable)
    - `streetview_angle` (integer, nullable)
  - `source` (string, nullable)
  - `original_source` (string, nullable)
- `building_history_url` (string, nullable)
- `estate_url` (string, nullable)
- `listings_url` (string, nullable)
- `news_url` (string, nullable)

## Errors

### 422 — Validation Error

The request body did not validate

What to do: Check the fields against this schema. A URN with the wrong prefix is the most common cause.

- `detail` (array)
  - `loc` (array, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (object)

### 408

The request ran past its time limit

What to do: Raise `timeout` in the request body, up to the maximum this endpoint documents. Lowering `count` or turning off the `with_*` flags also helps, because less work finishes sooner.

### 412

No deal with this transaction id.

What to do: Retrying will not help: either the entity does not exist, or the input points at a different one.

### 429

Too many requests: a rate limit or a usage window is exhausted

What to do: When the response carries an X-Retry-After header, wait that many seconds and retry: the same number is in the body as `detail.retry_after`, and the limit clears once that window passes. The message in the body names the limit that was hit.

### 500

Something broke on our side

What to do: Retrying will not help. If it keeps happening, send us the X-Request-ID from the response headers.

### 529

Rate limit reached, or the endpoint is overloaded

What to do: Wait at least 30 seconds, then retry.

## Response envelope

Success: Array of objects (may be empty if no results)

Error: Error may coexist with partial results if it occurs mid-execution. Check X-Error header and status code.

Every response carries these headers:

- `X-Error` — Error message text (present only on error)
- `X-Request-ID` — Unique request identifier
- `X-Execution-Time` — Execution time in seconds
- `X-Result-Count` — How many records the body carries. 0 means an empty result, which is a normal answer and not by itself an error. A non-zero count can come back together with X-Error when the failure happened partway through — read this header and X-Error independently.
- `X-Total-Available-Results` — How many records exist for this query, when the endpoint can say. On a `dry_run` request this is the answer and the body is empty. It saturates: the endpoint's documented maximum means 'at least that many', any smaller number is exact.
- `X-Warning` — Present when the request body carried keys this endpoint does not document. They were ignored, so any filter you meant to apply through them did not apply. Check the spelling against this schema and retry.
- `X-Retry-After` — Seconds to wait before retrying. Present only on 429.

