https://github.com/techwithty/crime_data
Crime data API integration for real estate risk analysis.
https://github.com/techwithty/crime_data
api crime fastapi geospatial python real-estate
Last synced: 4 months ago
JSON representation
Crime data API integration for real estate risk analysis.
- Host: GitHub
- URL: https://github.com/techwithty/crime_data
- Owner: TechWithTy
- Created: 2025-08-31T11:54:16.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-08-31T11:56:13.000Z (6 months ago)
- Last Synced: 2025-08-31T13:24:45.763Z (6 months ago)
- Topics: api, crime, fastapi, geospatial, python, real-estate
- Language: Python
- Homepage: https://www.cybershoptech.com
- Size: 1.95 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Crime Data Integration (Provider-agnostic)
Proxies a provider-agnostic crime data API (e.g., SpotCrime-like) through our backend.
## Environment Variables
- CRIME_DATA_BASE_URL (required)
- CRIME_DATA_API_KEY (optional; used as Bearer in Authorization header)
- CRIME_DATA_TIMEOUT (default: 15)
Example .env:
CRIME_DATA_BASE_URL=https://api.your-crime-provider.com
# Optional
CRIME_DATA_API_KEY=your_key_here
CRIME_DATA_TIMEOUT=15
## Endpoints
- GET /crime-data/health
- Returns: { healthy, base_url, has_api_key }
- GET /crime-data/{path}
- Proxies GET to: {CRIME_DATA_BASE_URL}/{path}
- Forwards query params verbatim.
Examples:
curl "http://localhost:8000/crime-data/health"
curl "http://localhost:8000/crime-data/incidents?lat=47.60&lon=-122.33&radius=0.05"
## Internal Structure
- client.py: [CrimeDataClient](cci:2://file:///c:/Users/tyriq.DESKTOP-U7P592K/OneDrive/Documents/Github-New/deal-scale-backend-autoscaling/backend/app/core/third_party_integrations/crime_data/client.py:7:0-34:34) composes URL from base+path, adds optional `Authorization: Bearer `.
- api/proxy.py: Router (`/crime-data/health`, `/{path}`), minimal utility wrapper.
- api/routes.py: Aggregates proxy sub-router without double prefix.