Skip to content

About

A simple FastAPI project that exposes housing data from a private database through an API endpoint. This project was created for learning purposes and was designed to provide data for a real-time housing dashboard.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

Housing Data API

A simple FastAPI project that exposes housing data from a private database through an API endpoint.

This project was created for learning purposes and was designed to provide data for a real-time housing dashboard.

Purpose

The API demonstrates how to:

  • Connect a FastAPI application to a database
  • Query housing listings
  • Filter data by city, date, and price
  • Expose database data through a REST endpoint

Important

This project cannot be run completely without access to the private database and its connection string.

The database connection is configured with the URL_CONN environment variable:

URL_CONN=your_database_connection_string

Run the API

Install the dependencies:

pip install -r requirements.txt

Start the server:

uvicorn main:app --reload --port 8001

Open the API documentation:

http://127.0.0.1:8001/docs

Main endpoint

GET /housing

Example:

/housing?city=Rabat&price_min=1000000&price_max=5000000

Supported cities:

  • Rabat
  • Tanger
  • Casablanca

Database

The API expects a database table named:

housing_listings

The project is intended for learning and demonstration purposes.

About

A simple FastAPI project that exposes housing data from a private database through an API endpoint. This project was created for learning purposes and was designed to provide data for a real-time housing dashboard.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages