@kite-sa/sdk 0.7.0 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,40 @@ export type Request = <T>(method: string, path: string, options?: {
24
24
  /** Every endpoint in the spec, namespaced by its operationId. */
25
25
  export declare function createEndpoints(request: Request): {
26
26
  readonly analytics: {
27
+ /**
28
+ * List advertisers by matching listings. The advertisers behind the listings a
29
+ * search matches: one row per advertiser, with how many matching listings they
30
+ * hold, their price range and where they list.
31
+ */
32
+ readonly advertisers: (params: QueryOf<"analytics.advertisers">) => Promise<{
33
+ data: {
34
+ price_basis: string;
35
+ price_source: string;
36
+ totals: {
37
+ advertisers: number;
38
+ listings: number;
39
+ };
40
+ advertisers: {
41
+ name: string;
42
+ advertiser_types: string[];
43
+ fal_number: string | null;
44
+ fal_licences: number;
45
+ sources: string[];
46
+ listings: number;
47
+ median_price_sar: number;
48
+ min_price_sar: number;
49
+ max_price_sar: number;
50
+ top_neighborhoods: {
51
+ neighborhood_id: number;
52
+ name_ar: string;
53
+ name_en: string;
54
+ listings: number;
55
+ }[];
56
+ sample_listing_ids: number[];
57
+ }[];
58
+ };
59
+ pagination: import("./openapi-zod/models.js").Pagination;
60
+ }>;
27
61
  /**
28
62
  * Find below-market listings. Residential listings asking noticeably less than
29
63
  * similar listings nearby, biggest gap first.
@@ -177,6 +211,7 @@ export declare function createEndpoints(request: Request): {
177
211
  neighborhood_id: number;
178
212
  name_en: string;
179
213
  name_ar: string;
214
+ town: import("./openapi-zod/models.js").NeighborhoodTown;
180
215
  sample_size: number;
181
216
  median_price_sar: unknown;
182
217
  p25_price_sar: unknown;
@@ -243,6 +278,7 @@ export declare function createEndpoints(request: Request): {
243
278
  neighborhood_id: number;
244
279
  name_en: string | null;
245
280
  name_ar: string | null;
281
+ town: import("./openapi-zod/models.js").NeighborhoodTown;
246
282
  }[];
247
283
  price_source: string;
248
284
  window: {
@@ -275,6 +311,7 @@ export declare function createEndpoints(request: Request): {
275
311
  neighborhood_id: unknown;
276
312
  name_en: string | null;
277
313
  name_ar: string | null;
314
+ town: import("./openapi-zod/models.js").NeighborhoodTown;
278
315
  change_pct: number | null;
279
316
  index_change_pct: number | null;
280
317
  index_base_month: string | null;
@@ -328,6 +365,19 @@ export declare function createEndpoints(request: Request): {
328
365
  data: import("./openapi-zod/models.js").Listing[];
329
366
  missing_ids: number[];
330
367
  }>;
368
+ /**
369
+ * Get a listing's advertiser contact. The advertiser's phone number for one
370
+ * active listing.
371
+ */
372
+ readonly contact: (id: string | number) => Promise<{
373
+ data: {
374
+ available: boolean;
375
+ reason: unknown;
376
+ phone: string | null;
377
+ whatsapp: string | null;
378
+ source_url: string | null;
379
+ };
380
+ }>;
331
381
  /** Count listings. How many listings match the same filters as search. */
332
382
  readonly count: (params: QueryOf<"listings.count">) => Promise<{
333
383
  data: {
@@ -365,6 +415,104 @@ export declare function createEndpoints(request: Request): {
365
415
  }>;
366
416
  };
367
417
  readonly market: {
418
+ /**
419
+ * Project absorption by area, developer or type. Month-by-month absorption
420
+ * pooled over projects: per city (the default), neighborhood, developer,
421
+ * property type or project type, the units on offer at the start and end of each
422
+ * month, units gone, released and re-added, the pooled and median absorption
423
+ * rate, and months of stock at the month's pace.
424
+ */
425
+ readonly absorption: (params?: QueryOf<"market.absorption">) => Promise<{
426
+ data: {
427
+ filters: {
428
+ city: string | null;
429
+ neighborhood_ids: unknown;
430
+ developer: string | null;
431
+ property_type: string | null;
432
+ project_type: string | null;
433
+ };
434
+ listing_type: string;
435
+ group_by: string;
436
+ from: string;
437
+ to: string;
438
+ min_sample_size: number;
439
+ projects_ungrouped: number;
440
+ groups: {
441
+ city: string | null;
442
+ neighborhood_id: unknown;
443
+ neighborhood_name_ar: string | null;
444
+ neighborhood_name_en: string | null;
445
+ developer: string | null;
446
+ property_type: string | null;
447
+ project_type: string | null;
448
+ projects_tracked: number;
449
+ projects_with_usable_month: number;
450
+ months: {
451
+ month: string;
452
+ projects_observed: number;
453
+ projects_usable: number;
454
+ start_available: unknown;
455
+ end_available: unknown;
456
+ units_gone: unknown;
457
+ units_released: unknown;
458
+ units_re_added: unknown;
459
+ absorption_rate: number | null;
460
+ median_project_absorption_rate: number | null;
461
+ units_gone_per_month: number | null;
462
+ months_of_stock: number | null;
463
+ flagged: {
464
+ gap: number;
465
+ withdrawal: number;
466
+ source_change: number;
467
+ released: number;
468
+ units_removed: number;
469
+ series_starts_mid_month: number;
470
+ series_ends_mid_month: number;
471
+ project_inactive: number;
472
+ month_in_progress: number;
473
+ no_inventory: number;
474
+ no_observations: number;
475
+ };
476
+ }[];
477
+ }[];
478
+ };
479
+ }>;
480
+ /**
481
+ * Places, population and landmarks around a point or in a neighborhood. What is
482
+ * around a location: mapped places by category, the resident population and how
483
+ * it changed over five years, and the nearest landmarks.
484
+ */
485
+ readonly areaContext: (params?: QueryOf<"market.area_context">) => Promise<{
486
+ data: {
487
+ area: {
488
+ method: string;
489
+ center: {
490
+ lat: number;
491
+ lng: number;
492
+ };
493
+ radius_m: unknown;
494
+ district_name: string | null;
495
+ area_sqkm: number;
496
+ neighborhood: unknown;
497
+ };
498
+ places: unknown;
499
+ population: unknown;
500
+ landmarks: {
501
+ name: string;
502
+ name_ar: string | null;
503
+ category: string;
504
+ distance_m: number;
505
+ }[];
506
+ attribution: {
507
+ notice: string;
508
+ sources: {
509
+ name: string;
510
+ licence: string;
511
+ url: string;
512
+ }[];
513
+ };
514
+ };
515
+ }>;
368
516
  /**
369
517
  * Area distribution. Histogram and percentiles of floor/plot area (m²) over
370
518
  * listings in the sample that state an area (`without_area_count` did not).
@@ -406,6 +554,54 @@ export declare function createEndpoints(request: Request): {
406
554
  };
407
555
  };
408
556
  }>;
557
+ /**
558
+ * Registered sale price against the asking price. What plots advertised for sale
559
+ * went on to register at, as a share of what their ads were asking: a
560
+ * negotiation margin to set bids by.
561
+ */
562
+ readonly askToDeal: (params: QueryOf<"market.ask_to_deal">) => Promise<{
563
+ data: {
564
+ filters: {
565
+ city: string;
566
+ neighborhood_ids: unknown;
567
+ group_by: string;
568
+ kind: string;
569
+ property_types: string[];
570
+ };
571
+ period: {
572
+ first_month: string | null;
573
+ last_month: string | null;
574
+ };
575
+ min_sample_size: number;
576
+ cells: {
577
+ neighborhood: unknown;
578
+ deals: number;
579
+ listings: number;
580
+ listings_still_active: number;
581
+ sample_size: number;
582
+ median_deal_to_ask: number | null;
583
+ p25_deal_to_ask: number | null;
584
+ p75_deal_to_ask: number | null;
585
+ days_sample_size: number;
586
+ median_days_to_sell: unknown;
587
+ by_registry: {
588
+ registry: string;
589
+ deals: number;
590
+ sample_size: number;
591
+ median_deal_to_ask: number | null;
592
+ median_days_to_sell: unknown;
593
+ }[];
594
+ }[];
595
+ attribution: {
596
+ notice: string;
597
+ sources: {
598
+ name: string;
599
+ name_ar: string;
600
+ url: string;
601
+ }[];
602
+ };
603
+ };
604
+ }>;
409
605
  /**
410
606
  * Commercial rent per m² by neighborhood. Asking rent per m² of commercial space
411
607
  * (shops, offices, warehouses, commercial land and whole buildings) by
@@ -453,6 +649,7 @@ export declare function createEndpoints(request: Request): {
453
649
  neighborhood_id: number;
454
650
  name_ar: string;
455
651
  name_en: string;
652
+ town: import("./openapi-zod/models.js").NeighborhoodTown;
456
653
  center: unknown;
457
654
  property_type: string;
458
655
  sample_size: number;
@@ -487,6 +684,7 @@ export declare function createEndpoints(request: Request): {
487
684
  neighborhood_ids: unknown;
488
685
  group_by: string;
489
686
  land_use: string;
687
+ include_token_prices: boolean;
490
688
  };
491
689
  asset: string;
492
690
  price_basis: string;
@@ -504,7 +702,7 @@ export declare function createEndpoints(request: Request): {
504
702
  deal_count: number;
505
703
  suppressed: boolean;
506
704
  complete: boolean;
507
- coverage_flag: import("./openapi-zod/models.js").CoverageFlag;
705
+ coverage_flag: import("./openapi-zod/models.js").TransactionCoverageFlag;
508
706
  median_price_per_sqm_sar: unknown;
509
707
  p25_price_per_sqm_sar: unknown;
510
708
  p75_price_per_sqm_sar: unknown;
@@ -518,6 +716,42 @@ export declare function createEndpoints(request: Request): {
518
716
  attribution: import("./openapi-zod/models.js").TransactionAttribution;
519
717
  };
520
718
  }>;
719
+ /**
720
+ * Plots for sale against their last registered sale. How the plots on the market
721
+ * compare with what they last sold for.
722
+ */
723
+ readonly landResale: (params: QueryOf<"market.land_resale">) => Promise<{
724
+ data: {
725
+ filters: {
726
+ city: string;
727
+ neighborhood_ids: unknown;
728
+ group_by: string;
729
+ kind: string;
730
+ property_types: string[];
731
+ };
732
+ min_sample_size: number;
733
+ cells: {
734
+ neighborhood: unknown;
735
+ listings_on_parcel: number;
736
+ with_last_sale: number;
737
+ sold_within_12_months: number;
738
+ sold_within_12_months_share: number | null;
739
+ sample_size: number;
740
+ median_ask_to_last_sale: number | null;
741
+ p25_ask_to_last_sale: number | null;
742
+ p75_ask_to_last_sale: number | null;
743
+ median_months_since_last_sale: unknown;
744
+ }[];
745
+ attribution: {
746
+ notice: string;
747
+ sources: {
748
+ name: string;
749
+ name_ar: string;
750
+ url: string;
751
+ }[];
752
+ };
753
+ };
754
+ }>;
521
755
  /**
522
756
  * Prices by neighborhood. Median and quartile price per neighborhood in a city,
523
757
  * most expensive first.
@@ -539,6 +773,7 @@ export declare function createEndpoints(request: Request): {
539
773
  neighborhood_id: number;
540
774
  name_ar: string;
541
775
  name_en: string;
776
+ town: import("./openapi-zod/models.js").NeighborhoodTown;
542
777
  center: unknown;
543
778
  sample_size: number;
544
779
  median_price_sar: unknown;
@@ -635,6 +870,7 @@ export declare function createEndpoints(request: Request): {
635
870
  neighborhood_id: number;
636
871
  name_ar: string;
637
872
  name_en: string;
873
+ town: import("./openapi-zod/models.js").NeighborhoodTown;
638
874
  sample_size: number;
639
875
  median_price_sar: unknown;
640
876
  }[];
@@ -695,6 +931,8 @@ export declare function createEndpoints(request: Request): {
695
931
  neighborhood_ids: unknown;
696
932
  group_by: string;
697
933
  land_use: unknown;
934
+ property_type: unknown;
935
+ include_token_prices: boolean;
698
936
  };
699
937
  price_basis: string;
700
938
  price_source: string;
@@ -707,11 +945,12 @@ export declare function createEndpoints(request: Request): {
707
945
  quarter: string;
708
946
  period_start: string;
709
947
  neighborhood: unknown;
710
- land_use: string;
948
+ land_use: unknown;
949
+ property_type: unknown;
711
950
  deal_count: number;
712
951
  suppressed: boolean;
713
952
  complete: boolean;
714
- coverage_flag: import("./openapi-zod/models.js").CoverageFlag;
953
+ coverage_flag: import("./openapi-zod/models.js").TransactionCoverageFlag;
715
954
  median_price_per_sqm_sar: unknown;
716
955
  p25_price_per_sqm_sar: unknown;
717
956
  p75_price_per_sqm_sar: unknown;
@@ -721,6 +960,7 @@ export declare function createEndpoints(request: Request): {
721
960
  p75_price_sar: unknown;
722
961
  median_area_sqm: unknown;
723
962
  }[];
963
+ window_totals: unknown;
724
964
  coverage: import("./openapi-zod/models.js").TransactionCoverage;
725
965
  attribution: import("./openapi-zod/models.js").TransactionAttribution;
726
966
  };
@@ -1121,6 +1361,21 @@ export declare function createEndpoints(request: Request): {
1121
1361
  previous_secret_expires_at: unknown;
1122
1362
  };
1123
1363
  }>;
1364
+ /**
1365
+ * Send a test event. Sends one event of `event_type` (default
1366
+ * `listing.created`) to the endpoint now and returns what it answered.
1367
+ */
1368
+ readonly test: (webhookId: string | number, body: BodyOf<"organization.webhooks.test">, headers?: HeaderOf<"organization.webhooks.test">) => Promise<{
1369
+ data: {
1370
+ delivery_id: number;
1371
+ event_id: string;
1372
+ event_type: string;
1373
+ delivered: boolean;
1374
+ response_status: unknown;
1375
+ response_snippet: string | null;
1376
+ duration_ms: number;
1377
+ };
1378
+ }>;
1124
1379
  /**
1125
1380
  * Update a webhook endpoint. Changes the URL, event types, filters or
1126
1381
  * description of an endpoint; send only what changes.
@@ -1141,6 +1396,50 @@ export declare function createEndpoints(request: Request): {
1141
1396
  };
1142
1397
  };
1143
1398
  readonly projects: {
1399
+ /**
1400
+ * Get a project's absorption by month. How fast a project's offered units go,
1401
+ * per calendar month: units on offer at the start and end, units gone, units
1402
+ * re-added and released, the absorption rate (units gone ÷ units at the start),
1403
+ * and months of stock left at that pace.
1404
+ */
1405
+ readonly absorption: (id: string | number, params?: QueryOf<"projects.absorption">) => Promise<{
1406
+ data: {
1407
+ project_id: number;
1408
+ listing_type: string;
1409
+ from: string;
1410
+ to: string;
1411
+ basis: unknown;
1412
+ basis_source: string | null;
1413
+ reliability: string;
1414
+ history_days: number;
1415
+ first_observed: string | null;
1416
+ last_observed: string | null;
1417
+ readings: number;
1418
+ latest_available: unknown;
1419
+ usable_months: number;
1420
+ units_gone_per_month: number | null;
1421
+ months_of_stock: number | null;
1422
+ months: {
1423
+ month: string;
1424
+ window_start: string | null;
1425
+ window_end: string | null;
1426
+ observed_days: number;
1427
+ start_available: unknown;
1428
+ end_available: unknown;
1429
+ units_gone: number;
1430
+ units_removed: unknown;
1431
+ units_re_added: number;
1432
+ units_released: number;
1433
+ units_not_counted: number;
1434
+ absorption_rate: number | null;
1435
+ units_gone_per_month: number | null;
1436
+ months_of_stock: number | null;
1437
+ reliability: string;
1438
+ usable: boolean;
1439
+ flags: string[];
1440
+ }[];
1441
+ };
1442
+ }>;
1144
1443
  /**
1145
1444
  * Get a project's unit availability over time. Daily snapshots of a project's
1146
1445
  * unit count and the availability its source reports, as daily, weekly or
@@ -1157,9 +1456,16 @@ export declare function createEndpoints(request: Request): {
1157
1456
  to: string;
1158
1457
  unit_type: string | null;
1159
1458
  coverage: {
1459
+ source: string | null;
1160
1460
  first_snapshot: string | null;
1161
1461
  last_snapshot: string | null;
1162
1462
  snapshots: number;
1463
+ sources: {
1464
+ source: string;
1465
+ first_snapshot: string | null;
1466
+ last_snapshot: string | null;
1467
+ snapshots: number;
1468
+ }[];
1163
1469
  };
1164
1470
  points: {
1165
1471
  date: string;
@@ -1170,6 +1476,14 @@ export declare function createEndpoints(request: Request): {
1170
1476
  unit_types: unknown;
1171
1477
  starting_price: unknown;
1172
1478
  source: string;
1479
+ timeline: {
1480
+ handover_date: string | null;
1481
+ construction_progress_pct: number | null;
1482
+ sources: {
1483
+ handover_date: string | null;
1484
+ construction_progress_pct: string | null;
1485
+ };
1486
+ };
1173
1487
  }[];
1174
1488
  };
1175
1489
  }>;
@@ -1205,11 +1519,13 @@ export declare function createEndpoints(request: Request): {
1205
1519
  neighborhood_name_en: string | null;
1206
1520
  lat: number | null;
1207
1521
  lng: number | null;
1522
+ precision: unknown;
1208
1523
  };
1209
1524
  price: {
1210
1525
  starting_sar: unknown;
1211
1526
  from_sar: unknown;
1212
1527
  to_sar: unknown;
1528
+ source: string | null;
1213
1529
  };
1214
1530
  area_sqm: {
1215
1531
  min: number | null;
@@ -1233,6 +1549,42 @@ export declare function createEndpoints(request: Request): {
1233
1549
  virtual_tour: string | null;
1234
1550
  video: string | null;
1235
1551
  };
1552
+ timeline: {
1553
+ construction_start_date: string | null;
1554
+ sales_start_date: string | null;
1555
+ handover_date: string | null;
1556
+ construction_progress_pct: number | null;
1557
+ sources: {
1558
+ construction_start_date: string | null;
1559
+ sales_start_date: string | null;
1560
+ handover_date: string | null;
1561
+ construction_progress_pct: string | null;
1562
+ };
1563
+ };
1564
+ sales_terms: {
1565
+ down_payment_pct: number | null;
1566
+ payment_plans: unknown;
1567
+ sources: {
1568
+ down_payment_pct: string | null;
1569
+ payment_plans: string | null;
1570
+ };
1571
+ };
1572
+ licence: {
1573
+ number: string | null;
1574
+ valid_from: string | null;
1575
+ valid_to: string | null;
1576
+ land_area_sqm: number | null;
1577
+ escrow_bank: string | null;
1578
+ consultant: string | null;
1579
+ sources: {
1580
+ number: string | null;
1581
+ valid_from: string | null;
1582
+ valid_to: string | null;
1583
+ land_area_sqm: string | null;
1584
+ escrow_bank: string | null;
1585
+ consultant: string | null;
1586
+ };
1587
+ };
1236
1588
  source: {
1237
1589
  name: string;
1238
1590
  url: string | null;
@@ -1275,11 +1627,13 @@ export declare function createEndpoints(request: Request): {
1275
1627
  neighborhood_name_en: string | null;
1276
1628
  lat: number | null;
1277
1629
  lng: number | null;
1630
+ precision: unknown;
1278
1631
  };
1279
1632
  price: {
1280
1633
  starting_sar: unknown;
1281
1634
  from_sar: unknown;
1282
1635
  to_sar: unknown;
1636
+ source: string | null;
1283
1637
  };
1284
1638
  area_sqm: {
1285
1639
  min: number | null;
@@ -1292,6 +1646,15 @@ export declare function createEndpoints(request: Request): {
1292
1646
  bedrooms_max: unknown;
1293
1647
  };
1294
1648
  cover_image: string | null;
1649
+ timeline: {
1650
+ handover_date: string | null;
1651
+ construction_progress_pct: number | null;
1652
+ sources: {
1653
+ handover_date: string | null;
1654
+ construction_progress_pct: string | null;
1655
+ };
1656
+ };
1657
+ offplan_licence_no: string | null;
1295
1658
  last_seen_at: unknown;
1296
1659
  }[];
1297
1660
  pagination: import("./openapi-zod/models.js").Pagination;
@@ -1330,6 +1693,7 @@ export declare function createEndpoints(request: Request): {
1330
1693
  neighborhood_name_en: string | null;
1331
1694
  lat: number | null;
1332
1695
  lng: number | null;
1696
+ precision: unknown;
1333
1697
  };
1334
1698
  images: string[];
1335
1699
  source: {
@@ -1376,6 +1740,7 @@ export declare function createEndpoints(request: Request): {
1376
1740
  neighborhood_name_en: string | null;
1377
1741
  lat: number | null;
1378
1742
  lng: number | null;
1743
+ precision: unknown;
1379
1744
  };
1380
1745
  images: string[];
1381
1746
  source: {
@@ -1486,15 +1851,15 @@ export declare function createEndpoints(request: Request): {
1486
1851
  name_ar: string;
1487
1852
  name_en: string;
1488
1853
  direction_id: unknown;
1854
+ town: import("./openapi-zod/models.js").NeighborhoodTown;
1489
1855
  center: unknown;
1490
1856
  }[];
1491
1857
  }>;
1492
1858
  };
1493
1859
  readonly transactions: {
1494
1860
  /**
1495
- * Search registered deals. Individual sale deals registered with the Ministry of
1496
- * Justice, from its quarterly open data, in one city: month, neighborhood,
1497
- * land-use class, area, price and price per m².
1861
+ * Search registered deals. Individual registered sale deals in one city: month,
1862
+ * neighborhood, land-use class, area, price and price per m².
1498
1863
  */
1499
1864
  readonly search: (params: QueryOf<"transactions.search">) => Promise<{
1500
1865
  data: import("./openapi-zod/models.js").Transaction[];
@@ -1505,6 +1870,43 @@ export declare function createEndpoints(request: Request): {
1505
1870
  attribution: import("./openapi-zod/models.js").TransactionAttribution;
1506
1871
  }>;
1507
1872
  };
1873
+ readonly valuations: {
1874
+ /**
1875
+ * Check the asking price for any home. The asking-price range for a home you
1876
+ * describe, from the asking prices of similar homes nearby: like an appraiser's
1877
+ * comparables, but for any unit, not just one listed on Kite.
1878
+ */
1879
+ readonly askingRange: (params: QueryOf<"valuations.asking_range">) => Promise<{
1880
+ data: {
1881
+ status: string;
1882
+ reasons: string[];
1883
+ basis: string;
1884
+ notice: string;
1885
+ price_basis: string;
1886
+ range: unknown;
1887
+ median_interval: unknown;
1888
+ confidence: unknown;
1889
+ claimed_price_position: unknown;
1890
+ location: unknown;
1891
+ cohort: unknown;
1892
+ comparables: {
1893
+ listing_id: number;
1894
+ price_sar: number;
1895
+ area_sqm: number;
1896
+ price_per_sqm_sar: number;
1897
+ bedrooms: number;
1898
+ distance_m: number;
1899
+ days_since_seen: number;
1900
+ live: boolean;
1901
+ }[];
1902
+ inputs_ignored: string[];
1903
+ methodology_version: string;
1904
+ see_also: {
1905
+ registered_rents: string | null;
1906
+ };
1907
+ };
1908
+ }>;
1909
+ };
1508
1910
  };
1509
1911
  export type Endpoints = ReturnType<typeof createEndpoints>;
1510
1912
  export {};