# Short-Term Rental Calendar Availability Analyzer (`afkdigital/short-term-rental-calendar-availability-analyzer`) Actor

Analyze customer-authorized ICS, CSV and JSON calendars. Keep blocked, available and unknown nights separate from verified booking occupancy and nightly asking rates.

- **URL**: https://apify.com/afkdigital/short-term-rental-calendar-availability-analyzer.md
- **Developed by:** [AFK Digital](https://apify.com/afkdigital) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 listing calendar analyses

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Short-Term Rental Calendar Availability Analyzer

Analyze **your authorized ICS, CSV or JSON calendar exports** without scraping rental platforms. Report open, blocked and unknown stay nights, and calculate a separate confirmed-booking occupancy ratio only when verified reservation coverage and an explicit inventory denominator are supplied.

Built by AFK Digital. Product code: NEWAPI118.

### What this Actor does

- Reads customer-provided iCalendar/ICS, CSV and JSON files, supplied inline or as explicitly authorized HTTPS download URLs.
- Keeps available, blocked and unknown nights separate. A blocked calendar night is **never** assumed to be a reservation.
- Treats empty ICS nights as unknown by default. Open nights can be inferred only inside an explicit, caller-declared availability contract and coverage window.
- Deduplicates overlapping calendar and reservation nights.
- Separates base nightly asking prices from fees, taxes, minimum-stay conditions and realized revenue.
- Provides optional regional summaries of the supplied sample, with coverage limitations.

No PMS, Airbnb, Vrbo or other platform API integration is included. No login, cookies, platform scraping, proxy rotation or access-control bypass is performed.

### Quick start

Run the prefilled synthetic example in Apify Console. Its exact input is `examples/demo-input.json`. An empty raw input also selects this documented synthetic demo; any nonempty input is validated as customer input and must contain dates and metadata.

The example covers November 1 through November 10, 2026 (10 stay nights; `dateTo=2026-11-11` is exclusive):

| Metric | Result | Explanation |
|---|---:|---|
| Available nights | 5 | Declared empty-day contract covers 8 nights, of which 3 are blocked |
| Blocked nights | 3 | One event from Nov 2 to checkout Nov 5 |
| Unknown nights | 2 | Outside the declared calendar coverage |
| Observed nights | 8 | Available + blocked; excludes unknown |
| Blocked share | 37.5% | 3 / 8 known nights; this is not occupancy |
| Confirmed reserved nights | 2 | Verified reservation Nov 2 to checkout Nov 4 |
| Confirmed booking occupancy | 20% | 2 / 10 explicitly declared period inventory nights |
| Nightly asking price | USD 100 | Base nightly quote; cleaning fee excluded; not revenue |

A cancelled calendar event and a cancelled reservation in this example contribute no occupied or blocked nights.

### Input reference

| Field | Required | Meaning |
|---|---|---|
| `calendarFiles` | Optional | Array of file descriptors, one listing per file |
| `authorizedCalendarUrls` | Optional | Array of authorized HTTPS file descriptors |
| `listingMetadataFile` | Yes | CSV/JSON file descriptor with one unique row per listing |
| `optionalReservationsFile` | Optional | CSV/JSON reservation snapshot |
| `optionalRatesFile` | Optional | CSV/JSON base nightly asking rates |
| `dateFrom` | Yes | First included local stay date, YYYY-MM-DD |
| `dateTo` | Yes | Exclusive end date / checkout date, YYYY-MM-DD |
| `timezone` | Optional | IANA timezone; default UTC; per-listing override allowed |
| `asOfDate` | Optional | Supplied snapshot reference date or offset ISO timestamp; defaults to observation time |
| `maxListings` | Optional | 1-100, default 20; exceeding the limit fails rather than silently truncating |

An inline descriptor is `{ "format": "json", "content": "[{...}]" }`; `content` is a UTF-8 text string, not a local server path. For CSV, provide the CSV text and `format: "csv"`. ICS requires `format: "ics"`.

A download descriptor replaces `content` with `url` and adds `authorizationConfirmed: true`. `calendarFiles` and `authorizedCalendarUrls` descriptors also require `listingId`. The authorization flag is the caller's rights attestation, not a technical verification of a provider contract. Use only exports and endpoints you are entitled to process. No external provider's commercial data rights are implied.

Example ICS descriptor:

```json
{
  "listingId": "apt-001",
  "format": "ics",
  "content": "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nEND:VCALENDAR\r\n",
  "emptyMeansAvailable": false
}
```

To interpret empty days as available, set `emptyMeansAvailable: true`, provide `availabilityContract` (8-500 characters describing the actual source contract), and declare `coverageStart` and exclusive `coverageEnd`. This never establishes availability outside that window. Supply no guest names, contact details or access tokens in listing IDs or region labels.

#### Listing metadata

Each row requires `listingId`: 1-80 letters/digits/dots/underscores/hyphens, starting with a letter or digit. Optional `region` is a geographic label and `timezone` is an IANA zone.

To calculate occupancy, all of these must be present for the listing:

- `reservationsVerified: true` (CSV also accepts the literal `true`). This attests to a verified reservation snapshot, independently of calendar blocking.
- `reservationCoverageStart` and exclusive `reservationCoverageEnd` covering the complete analysis period.
- `occupancyDenominator: "period_nights"` to explicitly declare every analysis night as inventory; **or** `"supplied_inventory_nights"` with an `inventoryDates` JSON date array. CSV may encode that array as a JSON string.
- `optionalReservationsFile`, including an empty array if a complete verified snapshot has no reservations.

Inventory is never inferred from blocked calendars. A confirmed reservation outside declared inventory fails validation. Empty inventory produces a null occupancy rate, not a division by zero.

#### Calendar CSV/JSON rows

Use `date,status` for one-night entries, or `start,end,status` for ranges. End dates are exclusive. Allowed states: `available`, `blocked`, `unknown`. `cancelled`/`canceled` rows are ignored. Optional row `listingId` must match the file descriptor. Missing dates remain unknown unless an explicit empty-day contract applies. Overlapping available/blocked declarations are reported; blocked takes conservative precedence. Within the same contracted feed, ordinary events override empty-day defaults and do not count as conflicts.

#### Reservation rows

`listingId, checkIn, checkOut, status` are required. Optional `reservationId` and `updatedAt` select the latest snapshot revision. IDs and guest details are never exported. Use stable reservation IDs if sending revisions; otherwise rows are independently considered and nights are still deduplicated.

Counted statuses: `confirmed`, `checked_in`, `checked_out`. Ignored: `cancelled`, `canceled`, `pending`, `declined`, `no_show`. Unsupported statuses fail validation. For identical IDs, latest `updatedAt` wins; contradictory equal-time revisions fail. An update after `asOfDate` is rejected because the Actor cannot reconstruct the prior status.

Date-only values are listing-local dates. ISO datetimes with offsets are converted to the listing timezone before deriving stay dates. Floating local datetimes use the listing timezone, but ambiguous/nonexistent DST wall times are rejected. Checkout day contributes no night. DST does not change the number of calendar stay nights. A reservation must span at least one local night.

**Occupancy rate = distinct verified confirmed reservation nights / explicitly declared inventory nights.** This is a confirmed booking-night ratio, which may include future bookings. It does not prove physical guest presence, realized stays or realized revenue. For a realized-stay analysis, provide a verified completed-stay dataset and a past analysis period with an appropriate inventory denominator. The Actor never relabels ordinary calendar blocks as actual occupancy.

#### ICS semantics and scope

- All-day `DTSTART` is included; `DTEND` is exclusive. A date-only event without an end/duration lasts one day.
- Timed events use local arrival-date to departure-date lodging semantics. Same-local-day timed events contain zero stay nights. Use explicit daily CSV/JSON states for partial-day operating restrictions.
- Cancelled and transparent events do not block nights. `METHOD:CANCEL` is a cancellation message, not a complete availability snapshot.
- Revisions are selected by UID + recurrence ID, highest SEQUENCE then LAST-MODIFIED/DTSTAMP. Tied contradictory revisions fail.
- Daily, weekly, monthly and yearly recurrences, exclusion dates and recurrence exceptions are expanded with `recurring-ical-events`. Subdaily recurrences/BYHOUR/BYMINUTE/BYSECOND are rejected.
- TZIDs must be recognized IANA zones. Custom timezone names are unsupported. Floating times use listing timezone. A malformed calendar fails the run instead of silently publishing misleading open nights.
- ICS STATUS=CONFIRMED describes the calendar event, not a verified lodging reservation; it remains a block only.

#### Nightly rates

Rows contain `listingId`, `date` or `start,end`, `nightlyRate`, and uppercase three-letter `currency`. `kind` defaults to `nightly`; other kinds, including cleaning fee/tax/minimum-stay rows, are excluded. Supply correctly classified **base nightly amounts**; the Actor cannot infer a bundled quote's components. Currency labels are preserved; currencies are not converted or averaged together. The same quote repeated for one night is counted once. Conflicting quotes for one currency/night are excluded and counted in `conflictingQuoteNights`.

Each currency summary includes quoted nights, minimum, maximum, mean and median. Missing rates are omitted, not imputed as zero. Asking prices are never reported as income, revenue, ADR or RevPAR.

### Output

One Dataset row per successfully analyzed listing. Percentages are numeric fractions (0.2 means 20%).

| Field | Definition |
|---|---|
| `listingId`, `region` | Customer-safe listing identity and sample geography |
| `periodStart`, `periodEnd`, `timezone`, `periodDays` | Local inclusive start and exclusive end, zone and nights |
| `observedDays` | Available + blocked nights; excludes unknown |
| `availableDays`, `blockedDays`, `unknownDays` | Disjoint night counts summing to periodDays |
| `blockedShare`, `blockedShareBasis` | blockedDays / observedDays; null when no known days |
| `calendarConflictDays` | Nights with competing explicit availability/block declarations |
| `confirmedReservedNights` | Distinct verified reservation nights; null without verified complete snapshot |
| `occupancyRate`, `occupancyBasis`, `occupancyDenominatorNights` | Explicit booking-night ratio and denominator; null if unavailable/zero denominator |
| `overlappingReservationNights` | Duplicate night occurrences removed from reservation counting |
| `nightlyRateSummary`, `currency` | Per-currency asking-rate summaries; top-level currency null for absent/mixed currencies |
| `observedAt`, `asOfDate` | Processing observation time and caller's supplied snapshot reference |
| `limitations` | Evidence/coverage, contract, occupancy and pricing caveats |

`SUMMARY` in the default Key-Value Store contains sample regional summaries, known/unknown coverage, processed listing counts and billing-unit definition. Regional blocked share is weighted by known listing-nights; no occupancy extrapolation or market ranking is produced. Region summaries are omitted when the payment budget truncates listing output.

`observedAt` is processing time, not a provider freshness guarantee. `asOfDate` labels the supplied snapshot; historical calendar states cannot be reconstructed from a current feed. Supply genuinely historical files for historical analysis.

### Security, privacy and operating limits

- HTTPS port 443 only. Userinfo, fragments, control characters, local/private/reserved/mapped addresses and mixed public/private DNS answers are rejected.
- DNS results are validated and the connection is pinned to a validated public IP while retaining TLS certificate/hostname validation. Redirects and compressed responses are rejected. No cookies, caller headers or credentials are forwarded.
- Maximum 1 MiB per file and 10 MiB total input/downloaded file content; 200 calendar files; 100 listings; 1-366 nights; 50,000 combined calendar-table/reservation/rate rows; 10,000 raw and 20,000 expanded ICS events per file.
- Downloads have a shared 45-second budget and 5-second socket timeouts. Analysis runs in an isolated subprocess with 150-second wall limit, 60 CPU seconds and 384 MiB address-space limit. Default Apify run: 512 MiB, timeout 240 seconds.
- Outputs and error messages omit source URLs/query tokens, UIDs, event descriptions, guest names, emails and reservation IDs. Unknown source fields are ignored. Use anonymous listing IDs and geographic labels; deliberately putting personal data in these output fields cannot be automatically detected reliably.
- Your original Actor input and files may remain in **your private Apify run storage** according to platform retention/access settings. Do not publish/share those inputs. Export only anonymous data, restrict run access and delete inputs or rotate sensitive feed URLs as needed.
- Failures are reported with sanitized messages. Invalid inputs produce no listing charge. Apify platform infrastructure may still have a small execution cost during failed/private runs.

### Pricing unit

Pay-Per-Event event: `listing-analysis`, **one emitted listing analysis of at most 366 local nights**. Price: **USD 0.01 per listing analysis (USD 10 per 1,000)**. Calendar, verified reservation and rate calculations are included in that unit. There is no per-day or regional-summary event and no paid PMS/data provider dependency.

Use Apify's maximum total charge setting to bound paid runs. The minimum run budget is USD 0.01, covering one listing analysis. There is no additional startup event or separate platform-usage surcharge. The Actor uses the SDK's combined Dataset push-and-charge operation and stops on its charge-limit signal.

### Integrations

- Import `examples/n8n-workflow.json`; configure an HTTP Header Auth credential with header `Authorization: Bearer YOUR_APIFY_TOKEN`. Replace synthetic input with authorized records. The example calls the synchronous dataset endpoint and returns listing rows.
- Follow `examples/MAKE.md` and `examples/make-http-request.json` for a Make HTTP-module configuration. The JSON is a request configuration example, not a Make scenario blueprint.
- Read `SUMMARY` separately from the run's default Key-Value Store for regional sample coverage.

The synchronous endpoint waits for completion; use asynchronous run creation plus polling/webhooks for production pipelines with shorter client timeouts. Do not place API tokens in URLs or exported workflow files.

### Development and verification

Python 3.13; dependencies locked in `requirements.lock`. Run `.venv/bin/python -m unittest discover -s tests -v` on a development installation. `Dockerfile`, Actor input/output schemas and Dataset view are included. Evidence under the product's `evidence/` directory records actual build/run IDs, runtime, cost and validation, independently from publication status.

# Actor input Schema

## `calendarFiles` (type: `array`):

At most 200 descriptors {listingId,format,content}. format: ics/csv/json. UTF-8; 1 MiB each. Empty ICS days remain unknown unless emptyMeansAvailable=true plus availabilityContract,coverageStart,coverageEnd.

## `authorizedCalendarUrls` (type: `array`):

Descriptors {listingId,format,url,authorizationConfirmed:true}. HTTPS public destinations only; no redirects, auth headers, proxy, cookies, login or platform access bypass. Signed query URLs remain private inputs.

## `listingMetadataFile` (type: `object`):

CSV/JSON descriptor {format,content} or authorized HTTPS url. One row per listing. See README for verified reservation coverage and occupancy denominator fields.

## `optionalReservationsFile` (type: `object`):

CSV/JSON file descriptor. Records: listingId, reservationId, checkIn, checkOut, status, updatedAt. Guest fields are ignored and never exported. Metadata reservationsVerified and explicit coverage/denominator are required for occupancy.

## `optionalRatesFile` (type: `object`):

CSV/JSON descriptor. Records: listingId, date or start/end, nightlyRate,currency,kind=nightly. Fees, taxes and minimum-stay rows are excluded. No revenue calculation.

## `dateFrom` (type: `string`):

YYYY-MM-DD, inclusive.

## `dateTo` (type: `string`):

YYYY-MM-DD, exclusive. Maximum 366 nights.

## `timezone` (type: `string`):

IANA timezone, overridable per listing metadata.

## `asOfDate` (type: `string`):

Optional YYYY-MM-DD or ISO datetime with offset, no future dates. Does not reconstruct history. Reservation updatedAt after this cutoff is rejected.

## `maxListings` (type: `integer`):

Hard fail rather than silently omit listings exceeding this limit.

## Actor input object example

```json
{
  "calendarFiles": [
    {
      "listingId": "demo-istanbul-01",
      "format": "ics",
      "content": "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AFK Digital//Demo//EN\r\nBEGIN:VEVENT\r\nUID:block-demo\r\nDTSTAMP:20260101T000000Z\r\nDTSTART;VALUE=DATE:20261102\r\nDTEND;VALUE=DATE:20261105\r\nSUMMARY:Private source detail omitted from output\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nUID:cancel-demo\r\nDTSTAMP:20260101T000000Z\r\nDTSTART;VALUE=DATE:20261106\r\nDTEND;VALUE=DATE:20261108\r\nSTATUS:CANCELLED\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n",
      "emptyMeansAvailable": true,
      "availabilityContract": "Customer export contract declares unlisted nights open within coverage.",
      "coverageStart": "2026-11-01",
      "coverageEnd": "2026-11-09"
    }
  ],
  "listingMetadataFile": {
    "format": "json",
    "content": "[{\"listingId\": \"demo-istanbul-01\", \"region\": \"Istanbul\", \"reservationsVerified\": true, \"reservationCoverageStart\": \"2026-11-01\", \"reservationCoverageEnd\": \"2026-11-11\", \"occupancyDenominator\": \"period_nights\"}]"
  },
  "optionalReservationsFile": {
    "format": "json",
    "content": "[{\"listingId\": \"demo-istanbul-01\", \"reservationId\": \"demo-reservation-1\", \"checkIn\": \"2026-11-02\", \"checkOut\": \"2026-11-04\", \"status\": \"confirmed\"}, {\"listingId\": \"demo-istanbul-01\", \"reservationId\": \"demo-cancelled\", \"checkIn\": \"2026-11-06\", \"checkOut\": \"2026-11-08\", \"status\": \"cancelled\"}]"
  },
  "optionalRatesFile": {
    "format": "json",
    "content": "[{\"listingId\": \"demo-istanbul-01\", \"start\": \"2026-11-01\", \"end\": \"2026-11-11\", \"nightlyRate\": 100, \"currency\": \"USD\", \"kind\": \"nightly\"}, {\"listingId\": \"demo-istanbul-01\", \"date\": \"2026-11-01\", \"nightlyRate\": 30, \"currency\": \"USD\", \"kind\": \"cleaning_fee\"}]"
  },
  "dateFrom": "2026-11-01",
  "dateTo": "2026-11-11",
  "timezone": "Europe/Istanbul",
  "maxListings": 20
}
```

# Actor output Schema

## `listings` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "calendarFiles": [
        {
            "listingId": "demo-istanbul-01",
            "format": "ics",
            "content": "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//AFK Digital//Demo//EN\r\nBEGIN:VEVENT\r\nUID:block-demo\r\nDTSTAMP:20260101T000000Z\r\nDTSTART;VALUE=DATE:20261102\r\nDTEND;VALUE=DATE:20261105\r\nSUMMARY:Private source detail omitted from output\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nUID:cancel-demo\r\nDTSTAMP:20260101T000000Z\r\nDTSTART;VALUE=DATE:20261106\r\nDTEND;VALUE=DATE:20261108\r\nSTATUS:CANCELLED\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n",
            "emptyMeansAvailable": true,
            "availabilityContract": "Customer export contract declares unlisted nights open within coverage.",
            "coverageStart": "2026-11-01",
            "coverageEnd": "2026-11-09"
        }
    ],
    "listingMetadataFile": {
        "format": "json",
        "content": "[{\"listingId\": \"demo-istanbul-01\", \"region\": \"Istanbul\", \"reservationsVerified\": true, \"reservationCoverageStart\": \"2026-11-01\", \"reservationCoverageEnd\": \"2026-11-11\", \"occupancyDenominator\": \"period_nights\"}]"
    },
    "optionalReservationsFile": {
        "format": "json",
        "content": "[{\"listingId\": \"demo-istanbul-01\", \"reservationId\": \"demo-reservation-1\", \"checkIn\": \"2026-11-02\", \"checkOut\": \"2026-11-04\", \"status\": \"confirmed\"}, {\"listingId\": \"demo-istanbul-01\", \"reservationId\": \"demo-cancelled\", \"checkIn\": \"2026-11-06\", \"checkOut\": \"2026-11-08\", \"status\": \"cancelled\"}]"
    },
    "optionalRatesFile": {
        "format": "json",
        "content": "[{\"listingId\": \"demo-istanbul-01\", \"start\": \"2026-11-01\", \"end\": \"2026-11-11\", \"nightlyRate\": 100, \"currency\": \"USD\", \"kind\": \"nightly\"}, {\"listingId\": \"demo-istanbul-01\", \"date\": \"2026-11-01\", \"nightlyRate\": 30, \"currency\": \"USD\", \"kind\": \"cleaning_fee\"}]"
    },
    "dateFrom": "2026-11-01",
    "dateTo": "2026-11-11",
    "timezone": "Europe/Istanbul"
};

// Run the Actor and wait for it to finish
const run = await client.actor("afkdigital/short-term-rental-calendar-availability-analyzer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "calendarFiles": [{
            "listingId": "demo-istanbul-01",
            "format": "ics",
            "content": """BEGIN:VCALENDAR\r
VERSION:2.0\r
PRODID:-//AFK Digital//Demo//EN\r
BEGIN:VEVENT\r
UID:block-demo\r
DTSTAMP:20260101T000000Z\r
DTSTART;VALUE=DATE:20261102\r
DTEND;VALUE=DATE:20261105\r
SUMMARY:Private source detail omitted from output\r
END:VEVENT\r
BEGIN:VEVENT\r
UID:cancel-demo\r
DTSTAMP:20260101T000000Z\r
DTSTART;VALUE=DATE:20261106\r
DTEND;VALUE=DATE:20261108\r
STATUS:CANCELLED\r
END:VEVENT\r
END:VCALENDAR\r
""",
            "emptyMeansAvailable": True,
            "availabilityContract": "Customer export contract declares unlisted nights open within coverage.",
            "coverageStart": "2026-11-01",
            "coverageEnd": "2026-11-09",
        }],
    "listingMetadataFile": {
        "format": "json",
        "content": "[{\"listingId\": \"demo-istanbul-01\", \"region\": \"Istanbul\", \"reservationsVerified\": true, \"reservationCoverageStart\": \"2026-11-01\", \"reservationCoverageEnd\": \"2026-11-11\", \"occupancyDenominator\": \"period_nights\"}]",
    },
    "optionalReservationsFile": {
        "format": "json",
        "content": "[{\"listingId\": \"demo-istanbul-01\", \"reservationId\": \"demo-reservation-1\", \"checkIn\": \"2026-11-02\", \"checkOut\": \"2026-11-04\", \"status\": \"confirmed\"}, {\"listingId\": \"demo-istanbul-01\", \"reservationId\": \"demo-cancelled\", \"checkIn\": \"2026-11-06\", \"checkOut\": \"2026-11-08\", \"status\": \"cancelled\"}]",
    },
    "optionalRatesFile": {
        "format": "json",
        "content": "[{\"listingId\": \"demo-istanbul-01\", \"start\": \"2026-11-01\", \"end\": \"2026-11-11\", \"nightlyRate\": 100, \"currency\": \"USD\", \"kind\": \"nightly\"}, {\"listingId\": \"demo-istanbul-01\", \"date\": \"2026-11-01\", \"nightlyRate\": 30, \"currency\": \"USD\", \"kind\": \"cleaning_fee\"}]",
    },
    "dateFrom": "2026-11-01",
    "dateTo": "2026-11-11",
    "timezone": "Europe/Istanbul",
}

# Run the Actor and wait for it to finish
run = client.actor("afkdigital/short-term-rental-calendar-availability-analyzer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "calendarFiles": [
    {
      "listingId": "demo-istanbul-01",
      "format": "ics",
      "content": "BEGIN:VCALENDAR\\r\\nVERSION:2.0\\r\\nPRODID:-//AFK Digital//Demo//EN\\r\\nBEGIN:VEVENT\\r\\nUID:block-demo\\r\\nDTSTAMP:20260101T000000Z\\r\\nDTSTART;VALUE=DATE:20261102\\r\\nDTEND;VALUE=DATE:20261105\\r\\nSUMMARY:Private source detail omitted from output\\r\\nEND:VEVENT\\r\\nBEGIN:VEVENT\\r\\nUID:cancel-demo\\r\\nDTSTAMP:20260101T000000Z\\r\\nDTSTART;VALUE=DATE:20261106\\r\\nDTEND;VALUE=DATE:20261108\\r\\nSTATUS:CANCELLED\\r\\nEND:VEVENT\\r\\nEND:VCALENDAR\\r\\n",
      "emptyMeansAvailable": true,
      "availabilityContract": "Customer export contract declares unlisted nights open within coverage.",
      "coverageStart": "2026-11-01",
      "coverageEnd": "2026-11-09"
    }
  ],
  "listingMetadataFile": {
    "format": "json",
    "content": "[{\\"listingId\\": \\"demo-istanbul-01\\", \\"region\\": \\"Istanbul\\", \\"reservationsVerified\\": true, \\"reservationCoverageStart\\": \\"2026-11-01\\", \\"reservationCoverageEnd\\": \\"2026-11-11\\", \\"occupancyDenominator\\": \\"period_nights\\"}]"
  },
  "optionalReservationsFile": {
    "format": "json",
    "content": "[{\\"listingId\\": \\"demo-istanbul-01\\", \\"reservationId\\": \\"demo-reservation-1\\", \\"checkIn\\": \\"2026-11-02\\", \\"checkOut\\": \\"2026-11-04\\", \\"status\\": \\"confirmed\\"}, {\\"listingId\\": \\"demo-istanbul-01\\", \\"reservationId\\": \\"demo-cancelled\\", \\"checkIn\\": \\"2026-11-06\\", \\"checkOut\\": \\"2026-11-08\\", \\"status\\": \\"cancelled\\"}]"
  },
  "optionalRatesFile": {
    "format": "json",
    "content": "[{\\"listingId\\": \\"demo-istanbul-01\\", \\"start\\": \\"2026-11-01\\", \\"end\\": \\"2026-11-11\\", \\"nightlyRate\\": 100, \\"currency\\": \\"USD\\", \\"kind\\": \\"nightly\\"}, {\\"listingId\\": \\"demo-istanbul-01\\", \\"date\\": \\"2026-11-01\\", \\"nightlyRate\\": 30, \\"currency\\": \\"USD\\", \\"kind\\": \\"cleaning_fee\\"}]"
  },
  "dateFrom": "2026-11-01",
  "dateTo": "2026-11-11",
  "timezone": "Europe/Istanbul"
}' |
apify call afkdigital/short-term-rental-calendar-availability-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,afkdigital/short-term-rental-calendar-availability-analyzer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/KiyLRdFsQJecxknOH/builds/aRALxYBTRaN06N5AR/openapi.json
