### Install and Initialize Local Lifestyle Widget Source: https://proximitii.com/documentation Embed the Proximitii widget script and initialize it with your public key, center coordinates, and options. Ensure your public key is valid and the script is loaded. ```html
``` -------------------------------- ### Fetch location data via API Source: https://proximitii.com/documentation Examples for retrieving location data using Node.js and PHP. Ensure keys are stored securely on the backend. ```javascript const url = 'https://widget-api.proximitii.com/api/map/locations?lat=43.659251&long=-79.345218&dataType=all&radius=6400&limit=2&categories=coffee,park,elem'; const options = { method: 'GET', headers: { 'public_key': '{public_key}', 'private_key': '{private_key}' } }; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ```php 'https://widget-api.proximitii.com/api/map/locations?lat=43.659251&long=-79.345218&dataType=all&radius=6400&limit=2&categories=coffee,park,elem', CURLOPT_HTTPHEADER => [ 'public_key: {public_key}', 'private_key: {private_key}' ], ]); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### Fetch Demographics Data Source: https://proximitii.com/documentation Examples for retrieving demographic data using Node.js and PHP. Ensure keys are stored securely on the backend. ```javascript const baseUrl = 'https://api.proximitii.com/v1/demographics/'; const keyPublic = 'YOUR PUBLIC KEY'; const keyPrivate = 'YOUR PRIVATE KEY'; const headers = new Headers({ 'Public-Key': keyPublic, 'Private-Key': keyPrivate }); const params = new URLSearchParams({ lat: '42.3444676', lon: '-71.0691738', radius: '1', munit: 'mi', categories: 'all' }); async function getDemographics() { try { const requestUrl = `${baseUrl}?${params.toString()}`; const response = await fetch(requestUrl, { method: 'GET', headers: headers }); const data = await response.json(); console.log(data); return data; } catch (error) { console.error('Error fetching data:', error); } } getDemographics(); ``` ```php '42.3444676', 'lon' => '-71.0691738', 'radius' => '1', 'munit' => 'mi', 'categories'=>'all' ); $ch = curl_init ($url . '?' . http_build_query($params)); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); $data = json_decode ($data, true); ?> ``` -------------------------------- ### GET /commute Source: https://proximitii.com/documentation Retrieves statistics on how people commute to work and average commute times. ```APIDOC ## GET /commute ### Description Retrieves data on commute methods and average commute times for the population. ### Method GET ### Endpoint /commute ### Response #### Success Response (200) - **AvgCommuteTime** (percent) - Average commute time - **PctDrive** (percent) - People who drive to work - **PctCarpool** (percent) - People who carpool to work - **PctPublicTrans** (percent) - People who take public transit to work - **PctMotorcycle** (percent) - People who ride a motorcycle to work - **PctBicycle** (percent) - People who ride a bicycle to work - **PctWalk** (percent) - People who walk to work - **PctWorkHome** (percent) - People who work from home ``` -------------------------------- ### GET /demographics Source: https://proximitii.com/documentation Retrieves demographic data including home price breakdowns and move-in timelines. ```APIDOC ## GET /demographics ### Description Retrieves statistical data regarding home prices and resident move-in history. ### Method GET ### Endpoint /demographics ### Response #### Success Response (200) - **PctPrice2mPlus** (percent) - Home price over 2M - **PctMovedIn2021Plus** (percent) - Moved in after 2021 - **PctMovedIn2018** (percent) - Moved in between 2018-2021 - **PctMovedIn2010** (percent) - Moved in between 2010-2017 - **PctMovedIn2000** (percent) - Moved in between 2000-2009 - **PctMovedIn1990** (percent) - Moved in between 1990-1999 - **PctMovedIn1989Earlier** (percent) - Moved in before 1989 ``` -------------------------------- ### GET /workforce Source: https://proximitii.com/documentation Retrieves a breakdown of the workforce by industry sector. ```APIDOC ## GET /workforce ### Description Retrieves the percentage breakdown of the workforce across various industry sectors. ### Method GET ### Endpoint /workforce ### Response #### Success Response (200) - **PctInAgriOrForestOrFishOrHuntOrMining** (percent) - Agriculture, forestry, fishing, hunting, or mining - **PctInConstruction** (percent) - Construction - **PctInManufacturing** (percent) - Manufacturing - **PctInWholesaleOrRetail** (percent) - Wholesale or retail - **PctInTransportationOrWharehousingOrUtilities** (percent) - Transportation, warehousing, or utilities - **PctInInformation** (percent) - Information technology - **PctInFinanceOrInsurance** (percent) - Finance or insurance - **PctInRealEstateOrRentals** (percent) - Real estate, rentals or leasing - **PctInProOrSciOrTechServices** (percent) - Professional, scientific or tech services - **PctInAdminAndWasteMgmt** (percent) - Waste management - **PctInEduOrHealthOrSocialServices** (percent) - Education, health or social services - **PctInArtsOrEntOrRecOrFoodServices** (percent) - Arts, entertainment, recreation or food services - **PctInOtherServices** (percent) - Other services - **PctInPublicAdmin** (percent) - Public administration ``` -------------------------------- ### GET /v1/demographics/ Source: https://proximitii.com/documentation Retrieves demographic insights for a specific location defined by latitude and longitude. ```APIDOC ## GET /v1/demographics/ ### Description Retrieves hyperlocal demographic insights within a specified radius of a given latitude and longitude. ### Method GET ### Endpoint https://api.proximitii.com/v1/demographics/ ### Parameters #### Query Parameters - **lat** (decimal) - Required - Latitude of the center point (-90 to 90). - **lon** (decimal) - Required - Longitude of the center point (-180 to 180). - **radius** (integer) - Required - The search radius (500 - 3200). - **munit** (string) - Required - Unit of measurement (m for meters, mi for miles). - **categories** (string) - Optional - Comma-delimited list of specific categories to retrieve. ### Request Example GET https://api.proximitii.com/v1/demographics/?lat=42.3444676&lon=-71.0691738&radius=1&munit=mi&categories=all ``` -------------------------------- ### Demographic Data JSON Response Source: https://proximitii.com/documentation Example of the JSON structure returned by the Proximitii API containing population, age, language, economy, education, housing, commute, and workforce statistics. ```json { "data": { "population": { "Population": "1560", "Density": 13569, "PctWhite": 61.7, "PctBlack": 8.38, "PctNative": 0.28, "PctAsian": 16.95, "PctHawaiian": 0.22, "PctOtherRaceAlone": 4.44, "PctMultiRacial": 8.03, "HispanicOrLatino": null, "MedianAge": 38.05, "PctMarried": 34.81, "PctWithKids": 10.14, "PctPoverty": 20.85, "PctOtherLang": 33.09 }, "age": { "PctUnder5": 3.5, "PctBetween5_14": 4.99, "PctBetween15_19": 5.11, "PctBetween20_24": 10.55, "PctBetween25_34": 24.13, "PctBetween35_44": 12.3, "PctBetween45_54": 11.47, "PctBetween55_64": 11.52, "PctBetween65_84": 14.34, "PctOver85Plus": 2.08 }, "languages": { "PctSpeakEnglish": 66.91, "PctSpeakSpanish": 9.98, "PctSpeakEuropean": 7.69, "PctSpeakAsianPacific": 12.81, "PctSpeakOther": 2.61 }, "economy": { "IncomePerCapita": "106139.90", "MedHouseholdIncome": "119509.02", "PctUnemployed": 3.55, "PctInc10K_Less": 10.83, "PctInc10K_25K": 13.95, "PctInc25K_40K": 5.31, "PctInc40K_60K": 8.72, "PctInc60K_100K": 11.77, "PctInc100K_150K": 12.02, "PctInc150K_200K": 8.77, "PctInc200K_More": 28.63 }, "education": { "PctCompleted8thGrade": 94.61, "PctCompletedHighSchool": 90.54, "PctSomeCollege": 80.81, "PctAssDegree": 73.06, "PctBachelorsDegree": 69.81, "PctMastersDegree": 37.39, "PctProSchoolDegree": 16.44, "PctDoctorateDegree": 6.35 }, "housing": { "HousingUnits": "822", "Households": "761", "MedValueOwnerOccupied": "1330327", "MedRent": "2330", "AvgHouseholdSize": 1.76, "PctOwnerOccupied": 31.36, "PctRenterOccupied": 68.64, "PctPrice50k": 4.02, "PctPrice100k": 0.42, "PctPrice150k": 0, "PctPrice200k": 0.83, "PctPrice300k": 2.45, "PctPrice500k": 5.99, "PctPrice1m": 27.45, "PctPrice2m": 32.74, "PctPrice2mPlus": 26.1, "PctMovedIn2021Plus": 5.51, "PctMovedIn2018": 18.6, "PctMovedIn2010": 35.58, "PctMovedIn2000": 22.42, "PctMovedIn1990": 10.68, "PctMovedIn1989Earlier": 7.19, "PctSingleFamily": 1.38, "PctSemiDetached": 7.4, "PctTownhouse": 15.71, "PctSmallApt": 29.36, "PctLargeApt": 46.06 }, "commute": { "AvgCommuteTime": null, "PctDrive": 19.37, "PctCarpool": 2.84, "PctPublicTrans": 21.02, "PctMotorcycle": 0.03, "PctBicycle": 2.28, "PctWalk": 34.33, "PctWorkHome": 18.59 }, "workforce": { "PctInAgriOrForestOrFishOrHuntOrMining": 0.05, "PctInConstruction": 1.46, "PctInManufacturing": 5.05, "PctInWholesaleOrRetail": 7.35, "PctInTransportationOrWharehousingOrUtilities": 1.77, "PctInInformation": 2.38, "PctInFinanceOrInsurance": 13.01, "PctInRealEstateOrRentals": 2.23, "PctInProOrSciOrTechServices": 21.01, "PctInManagement": 0.18, "PctInAdminAndWasteMgmt": 2.76, "PctInEduOrHealthOrSocialServices": 28.99, "PctInArtsOrEntOrRecOrFoodServices": 8.37, "PctInOtherServices": 3.47, "PctInPublicAdmin": 1.92 } }, "error": { "code": "201", "message": "Created" } } ``` -------------------------------- ### GET /api/map/locations Source: https://proximitii.com/documentation Retrieves points of interest data based on specified location and search criteria. Requires public and private keys for authentication. ```APIDOC ## GET /api/map/locations ### Description Retrieves points of interest data based on specified location and search criteria. Requires public and private keys for authentication. ### Method GET ### Endpoint https://widget-api.proximitii.com/api/map/locations ### Query Parameters - **lat** (decimal) - Required - Sets the latitude of the center point for the search. Value must be between -90 and 90. - **long** (decimal) - Required - Sets the longitude of the center point for the search. Value must be between -180 and 180. - **dataType** (string) - Optional - Specifies the type of data to return. Accepted values: 'all', 'scores', 'locations', 'overall_score'. Defaults to 'all'. - **radius** (integer) - Optional - Sets the maximum search radius in meters. Accepted values: 1 - 20000. Defaults to 6400. - **limit** (integer) - Optional - Sets the maximum number of results to return. Accepted values: 1 - 25. Defaults to 12. - **categories** (string) - Optional - Selects specific categories to filter results. Values should be a comma-delimited string of accepted category variables. ### Headers - **public_key** (string) - Required - Your public API key. - **private_key** (string) - Required - Your private API key. ### Request Example (Node.js) ```javascript const url = 'https://widget-api.proximitii.com/api/map/locations?lat=43.659251&long=-79.345218&dataType=all&radius=6400&limit=2&categories=coffee,park,elem'; const options = { method: 'GET', headers: { 'public_key': '{public_key}', 'private_key': '{private_key}' } }; fetch(url, options) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` ### Request Example (PHP) ```php 'https://widget-api.proximitii.com/api/map/locations?lat=43.659251&long=-79.345218&dataType=all&radius=6400&limit=2&categories=coffee,park,elem', CURLOPT_HTTPHEADER => [ 'public_key: {public_key}', 'private_key: {private_key}' ], ]); $response = curl_exec($curl); curl_close($curl); echo $response; ``` ### Response #### Success Response (200) - **locations** (array) - An array of location objects. - **name** (string) - The name of the point of interest. - **category** (string) - The category of the point of interest. - **lat** (decimal) - The latitude of the point of interest. - **long** (decimal) - The longitude of the point of interest. - **score** (decimal) - The score associated with the point of interest (if applicable). #### Response Example ```json { "locations": [ { "name": "Example Park", "category": "park", "lat": 43.660000, "long": -79.350000, "score": 0.85 }, { "name": "Example Coffee Shop", "category": "coffee", "lat": 43.659000, "long": -79.340000, "score": 0.92 } ] } ``` ``` -------------------------------- ### Sample HTML File Source: https://proximitii.com/documentation A complete HTML file demonstrating the integration of Proximitii Maps, including necessary meta tags, styles, and script includes. ```html