Check the API docs
https://renewmap.readme.io/reference/get-project-locations-shpfile
You will need an API key to get started.
Check the Getting Started page for instructions.
Save and run this script in any Python environment to get the latest RenewMap Projects data as an Esri shapefile.
- Save the script below as a Python file, eg
get_renewmap_projects_shp.py
- Run the script in ArcGIS Pro:
- Open your project
- Open a Python window (
Alt + Shift + p
) - Paste and run the script
- A zipped folder containing the shapefile will save in your project working directory
- Alternatively, you can run the script in your favourite IDE, such as VSCode, or in a PowerShell or Bash terminal.
- Re-run the script to get the latest data.
"""
Updated: 10/06/2025
Author: [email protected]
This script fetches shapefile data from the RenewMap Project API and saves it to disk.
"""
import requests, zipfile, io
from typing import Dict
import os
API_KEY = "YOUR_API_KEY" # Replace with your actual API key
BASE_URL = "https://api.renewmap.com.au/api/v1/files/esri/shp/projects.zip"
SAVE_PATH = "projects" # Directory to extract to, without .zip extension
headers = {
"Authorization": f"Bearer {API_KEY}"
}
class APIConfig:
"""Configuration class for API parameters.
Attributes:
base_url: Base URL for the API endpoint
headers: HTTP headers for API requests
"""
base_url: str = BASE_URL
headers: Dict = headers
save_path: str = SAVE_PATH
def get_url(self):
return self.base_url
def fetch_shapefile(config: APIConfig) -> None:
"""Fetch shapefile data from API and save to disk.
Args:
config: APIConfig object containing API configuration
"""
url = config.get_url()
response = requests.get(url, headers=config.headers)
print(f"Fetching: {url}")
print(f"Status code: {response.status_code}")
if response.status_code == 200:
print("Data retrieved successfully")
# Create directory if it doesn't exist
os.makedirs(config.save_path, exist_ok=True)
# Extract the zip file
z = zipfile.ZipFile(io.BytesIO(response.content))
z.extractall(config.save_path)
print("Shapefile saved to:", config.save_path)
# Check for .shp files and print their paths
shp_files = [f for f in os.listdir(config.save_path) if f.endswith('.shp')]
if shp_files:
print("\nFound shapefiles:")
for shp_file in shp_files:
shp_path = os.path.join(config.save_path, shp_file)
print(f"- {os.path.abspath(shp_path)}")
else:
print("Warning: No .shp files found in the extracted contents")
else:
print("Error:", response.status_code)
config = APIConfig()
fetch_shapefile(config)