{
  "openapi": "3.0.1",
  "info": {
    "title": "Neighborhood Data API - Location Scores and Demographics",
    "description": "Score any US or Canadian address on 18 measures of walkability, transit, schools, groceries, nightlife, parks, greenery and quiet, then pull the neighborhood, city and metro area around it with demographics, schools, points of interest, market statistics and similar neighborhoods.",
    "version": "0.1",
    "x-build-id": "aWqLTcepCbIJgihh2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~neighborhood-data-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-neighborhood-data-api",
        "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/nabeelbaghoor~neighborhood-data-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-neighborhood-data-api",
        "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/nabeelbaghoor~neighborhood-data-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-neighborhood-data-api",
        "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",
        "properties": {
          "mode": {
            "title": "What to read",
            "enum": [
              "scores",
              "snapshot",
              "geographies",
              "profiles",
              "demographics",
              "schools",
              "pois",
              "marketStats",
              "valueDrivers",
              "similarNeighborhoods"
            ],
            "type": "string",
            "description": "Location scores rates a spot on 18 measures. Snapshot bundles scores with demographics, nearby place counts and distance measures. Geographies turns a coordinate into the areas that contain it, which is how you find the geography id the area modes need.",
            "default": "scores"
          },
          "coordinates": {
            "title": "Coordinates",
            "type": "array",
            "description": "One \"latitude, longitude\" pair per line, for example \"41.847206, -87.668825\". Used by the scores, snapshot, geographies, demographics, schools and points of interest modes.",
            "items": {
              "type": "string"
            }
          },
          "geographyIds": {
            "title": "Geography ids",
            "type": "array",
            "description": "One geography id per line, for example g30_dpz89rm7. Required by the profile, market statistics, value drivers and similar neighborhoods modes, and accepted by scores, demographics, schools and points of interest. Run the geographies mode on a coordinate to find ids.",
            "items": {
              "type": "string"
            }
          },
          "geographyLevels": {
            "title": "Geography levels",
            "type": "array",
            "description": "Which levels of area to return alongside a coordinate. Leave empty in scores mode to get the point score only. 10 neighborhood, 20 macro-neighborhood, 30 city, 32 zip or postal code, 35 county subdivision, 37 county, 38 region, 40 metro area, 60 state or province, 70 country.",
            "items": {
              "type": "string",
              "enum": [
                "10",
                "20",
                "30",
                "32",
                "35",
                "37",
                "38",
                "40",
                "60",
                "70"
              ],
              "enumTitles": [
                "10 - Neighborhood",
                "20 - Macro-neighborhood",
                "30 - City",
                "32 - ZIP or postal code",
                "35 - County subdivision",
                "37 - County",
                "38 - Region",
                "40 - Metro area",
                "60 - State or province",
                "70 - Country"
              ]
            }
          },
          "radius": {
            "title": "Search radius",
            "minimum": 1,
            "type": "integer",
            "description": "How far around each coordinate to look, for the snapshot, demographics, schools and points of interest modes. Leave empty for the provider's defaults: 500 m for demographics, a five minute walk for schools, 5 km for points of interest. Points of interest are capped at 25 km."
          },
          "radiusUnit": {
            "title": "Radius unit",
            "enum": [
              "meter",
              "mile"
            ],
            "type": "string",
            "description": "Whether the radius above is in metres or miles. Points of interest always use metres.",
            "default": "meter"
          },
          "poiCategories": {
            "title": "Point of interest categories",
            "type": "array",
            "description": "Points of interest mode. Keeps only these categories, for example cafes or groceries. One per line. Leave empty for every category. The provider returns at most 500 places per request.",
            "items": {
              "type": "string"
            }
          },
          "propertyTypes": {
            "title": "Property types",
            "type": "array",
            "description": "Market statistics mode. Which property types to report on. Leave empty for the provider's default set. Note that its commercial and unclassified groupings are for reconciling totals rather than for analysis.",
            "items": {
              "type": "string",
              "enum": [
                "all_residential_properties",
                "residential_income_properties",
                "single_family",
                "condo_townhome",
                "multi_family_under_5_units",
                "multi_family_5_plus_units",
                "vacant_land"
              ]
            }
          },
          "limit": {
            "title": "Items per area",
            "minimum": 1,
            "type": "integer",
            "description": "Value drivers and similar neighborhoods modes. How many to return per area. Similar neighborhoods are capped at 10."
          },
          "includeBoundaries": {
            "title": "Include boundary geometry",
            "type": "boolean",
            "description": "Geographies mode. Adds each area's boundary polygon to the row. Boundaries make rows much larger and are only published for some geographies.",
            "default": false
          },
          "roundScores": {
            "title": "Round scores to the nearest half point",
            "type": "boolean",
            "description": "Scores mode. The provider rounds point scores to the nearest 0.5 by default. Turn this off for unrounded values, which is what you want when ranking a list of addresses against each other.",
            "default": true
          },
          "language": {
            "title": "Language",
            "enum": [
              "en",
              "fr"
            ],
            "type": "string",
            "description": "The language for names and descriptive text. French is available for Canadian coverage.",
            "default": "en"
          },
          "maxResults": {
            "title": "Maximum rows",
            "minimum": 1,
            "type": "integer",
            "description": "The most rows this run will save and charge for. Schools and points of interest return many rows per location, so this is the spending control that matters most in those modes.",
            "default": 500
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "How fast to call the provider. Lower this if your agreement rate limits the run.",
            "default": 120
          },
          "clientId": {
            "title": "Client id",
            "type": "string",
            "description": "Your own client id for the neighborhood data provider. This actor is bring your own key: it signs in with your credentials only, and never uses anyone else's."
          },
          "clientSecret": {
            "title": "Client secret",
            "type": "string",
            "description": "Your own client secret for the neighborhood data provider. Exchanged for a short lived access token at the start of every run and stored as a secret."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}