{
  "openapi": "3.0.1",
  "info": {
    "title": "TruGrid AU — Australian Location Intelligence",
    "description": "Australian location intelligence for retail site selection and franchise planning. Enter an address, suburb or postcode to compare demographics, purchasing power and business context, rank nearby areas, and export clean CSV/JSON.",
    "version": "0.14",
    "x-build-id": "kmTGQPXmRrgXDEKwk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/trustats~trugrid-au/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-trustats-trugrid-au",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/trustats~trugrid-au/runs": {
      "post": {
        "operationId": "runs-sync-trustats-trugrid-au",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/trustats~trugrid-au/run-sync": {
      "post": {
        "operationId": "run-sync-trustats-trugrid-au",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "action"
        ],
        "properties": {
          "action": {
            "title": "❗ Action",
            "enum": [
              "create",
              "resume"
            ],
            "type": "string",
            "description": "Choose Create for a new request or Recover for an existing order. Recovery uses the original location and settings.",
            "default": "create"
          },
          "operation": {
            "title": "❗ Operation — required for a new query",
            "enum": [
              "profile",
              "score"
            ],
            "type": "string",
            "description": "Profile: descriptive data; leave Business preset EMPTY. Rank: scored shortlist; SELECT a Business preset. Switching from Rank to Profile? Clear the previously selected preset. Omit for recovery."
          },
          "location_id": {
            "title": "City reference point — choose this OR type below",
            "enum": [
              "sydney-cbd-nsw",
              "chatswood-nsw",
              "parramatta-nsw",
              "surry-hills-nsw",
              "bondi-junction-nsw",
              "north-sydney-nsw",
              "melbourne-cbd-vic",
              "brisbane-cbd-qld",
              "adelaide-sa",
              "perth-wa",
              "canberra-act",
              "hobart-tas",
              "darwin-nt",
              "gold-coast-qld",
              "newcastle-nsw",
              "wollongong-nsw",
              "geelong-vic",
              "maroochydore-qld",
              "cairns-qld",
              "townsville-qld",
              "toowoomba-qld",
              "ballarat-vic",
              "bendigo-vic",
              "albury-nsw",
              "launceston-tas"
            ],
            "type": "string",
            "description": "Optional ready-made centre point; NOT a city filter for the text search. Selecting Melbourne CBD means querying Melbourne CBD, not searching an address within Melbourne. To type Ringwood VIC 3134, CLEAR this dropdown first. Each reference queries nearby grid cells, not the whole city/suburb."
          },
          "location_text": {
            "title": "Type a place / address / postcode — leave City reference empty",
            "maxLength": 240,
            "type": "string",
            "description": "Use this box OR the city reference dropdown, never both. Example: Ringwood VIC 3134, or 1 Martin Place Sydney NSW 2000. Include state and postcode where possible. Clear coordinates and H3 fields. Search is not guaranteed: if the location needs clarification, inspect OUTPUT.location_candidates or use verified coordinates. A postcode selects a reference point, not its whole area. Non-catalogue text is sent to Photon/OpenStreetMap."
          },
          "latitude": {
            "title": "Latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Coordinates alternative: enter BOTH Latitude and Longitude, e.g. -37.8113584 and 145.230639. Clear the city dropdown, place/address/postcode text and H3 IDs."
          },
          "longitude": {
            "title": "Longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Enter together with Latitude, e.g. 145.230639. Leave blank when using a city reference, text search or H3 IDs."
          },
          "h3_cells": {
            "title": "H3 cell IDs",
            "maxLength": 2048,
            "type": "string",
            "description": "H3 alternative within section B: paste 1–37 resolution 9 IDs separated by commas, spaces or new lines. Leave latitude, longitude and section A blank."
          },
          "field_set": {
            "title": "Result package — Optional (Basic by default)",
            "enum": [
              "profile_basic",
              "commercial_context",
              "audience_context"
            ],
            "type": "string",
            "description": "Defaults to profile_basic when omitted on a new query. All packages include H3 and SA2 identifiers. Source/licence metadata is separate from these column counts. Omit for recovery."
          },
          "preset_id": {
            "title": "Business preset — ONLY for Rank (empty for Profile)",
            "enum": [
              "after_school_tutoring",
              "allied_health_clinic",
              "boutique_coffee_bakery",
              "qsr_asian_casual",
              "symbiotic_boutique_fashion_sydney_v1",
              "symbiotic_boutique_hotel_sydney_v1",
              "symbiotic_boutique_pilates_sydney_v1",
              "symbiotic_cocktail_bar_sydney_v1",
              "symbiotic_discount_pharmacy_sydney_v1",
              "symbiotic_fine_dining_sydney_v1",
              "symbiotic_gourmet_grocer_sydney_v1",
              "symbiotic_japanese_restaurant_v1",
              "symbiotic_k12_tutoring_sydney_v1",
              "symbiotic_mass_burger_sydney_v1",
              "symbiotic_outdoor_cycling_sydney_v1",
              "symbiotic_premium_bakery_sydney_v1",
              "symbiotic_premium_childcare_sydney_v1",
              "symbiotic_retail_bank_sydney_v1",
              "symbiotic_specialist_medical_sydney_v1",
              "symbiotic_specialty_coffee_sydney_v1"
            ],
            "type": "string",
            "description": "Rank nearby areas: choose one preset (required). Neighbourhood profile: leave EMPTY; clear an earlier selection when switching to Profile. Recovery: omit. Presets support screening, not revenue forecasts; the clinic preset targets dental competition."
          },
          "limit": {
            "title": "🔢 Maximum result rows",
            "minimum": 1,
            "maximum": 37,
            "type": "integer",
            "description": "1–37 rows; a new query defaults to 37 when omitted. This limits returned rows, not the area checked. Filters can return fewer or zero rows. Omit for recovery."
          },
          "hard_filters": {
            "title": "🔍 Minimum / maximum filters",
            "type": "object",
            "description": "Use allowed min_/max_ keys, for example {\"min_sa2_university_degree_share\":0.30} for 30%. Filters are not automatically relaxed. Omit for recovery."
          },
          "base_weights": {
            "title": "⚖️ Add or replace base-scoring weights",
            "type": "object",
            "description": "Ranking only. Allowed base variables accept weights from -100 to 100. Existing keys replace preset weights; new allowed keys add a contribution. Zero disables that scoring contribution. Omit for profile/recovery."
          },
          "request_key": {
            "title": "Repeat request key — Optional",
            "type": "string",
            "description": "Create only. Reuse this key only with the same request to refer to the original order. Normally leave blank; recovery uses order_id instead."
          },
          "order_id": {
            "title": "Original order ID — Optional (recovery only)",
            "type": "string",
            "description": "Copy order_id from ORDER_STATE. Choose Recover and turn Validate only off; omit location, operation, package, preset, limit, weights and filters. If OUTPUT directs you to the original run, open it and select Actions → Resurrect."
          },
          "product_mode": {
            "title": "Product mode",
            "pattern": "^daas$",
            "type": "string",
            "description": "Fixed product mode: daas.",
            "default": "daas"
          },
          "use_advanced_scope": {
            "title": "Use advanced JSON scope — Optional",
            "type": "boolean",
            "description": "Off: ignore the example below. On: use scope JSON as your location. Existing API scope requests without this flag remain supported.",
            "default": false
          },
          "scope": {
            "title": "🧩 Advanced scope — JSON/API compatibility",
            "type": "object",
            "description": "Editable example: replace latitude and longitude with your location; keep k_ring at 3. Enable the switch above to use it. Alternative H3 JSON: {\"type\":\"h3\",\"cells\":[\"89be0e966c7ffff\"]}. For ordinary H3 input, use the text box above instead."
          },
          "scope_template": {
            "title": "Advanced scope JSON — Optional multiline example",
            "maxLength": 4096,
            "type": "string",
            "description": "Editable example: replace latitude and longitude with your location; keep k_ring at 3. Enable the switch above to use it. Alternative H3 JSON: {\"type\":\"h3\",\"cells\":[\"89be0e27473ffff\"]}. For ordinary H3 input, use the text box above instead."
          },
          "dry_run": {
            "title": "Validate only — Optional",
            "type": "boolean",
            "description": "In the form, OFF (initial setting) requests data at the price in Pricing. ON checks the input only: no data rows and no business query fee. Leave OFF for normal queries and recovery. JSON/API clients should set dry_run explicitly.",
            "default": true
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}