Skip to content

A simple flask proxy which hides API keys and has rate limiting.

Notifications You must be signed in to change notification settings

bkyuchuk/python-api-proxy-server

Repository files navigation

Python API Proxy Server

A simple proxy server built with Flask (Python). It can be used for hiding API keys as well as rate limiting. This uses the OpenWeather API, but you can easily change it to whatever public API you want. The project is a spinoff of Brad Traversy's Node API Proxy Server.

Weather App

Usage

To install the dependencies you need to have Pipenv.

Install dependencies

pipenv install
pipenv shell
flask run

Run tests

pytest

Add public API info

Rename .env.example to .env and edit the values

If the public API URL is https://api.openweathermap.org/data/2.5/weather?q={city}&appid={APIkey}

You can add on any other query params as needed when hitting the /api endpoint such as https://yourdomain/api?q=Berlin without having to add your key in the client.

  • Add new routes as you see fit
  • Change rate limiting

This project is inspired by Brad Traversy's YouTube tutorial.

About

A simple flask proxy which hides API keys and has rate limiting.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published