Software Alternatives & Reviews

Creating and Hosting a Personal API with Flask and Code Capsules

Open Exchange Rates Gunicorn
  1. Free, hourly-updated exchange rates - a simple, accurate, open-source JSON API. Free for personal use, a bargain for everybody else.
    Import requests From flask import Flask, jsonify # Import Flask, import jsonify to return JSON info App = Flask(__name__) @app.route('/') # Create main page of web-application Def index(): return "Welcome to my API!" # Display text on main page EXCHANGE_URL = 'https://openexchangerates.org/api/latest.json?app_id=YOUR-API-KEY-HERE' EXCHANGE_PARAMS = {'symbols':'ZAR,EUR,CAD'} Exchange_data = requests.get(EXCHANGE_URL, EXCHANGE_PARAMS) WEATHER_URL = 'http://api.weatherstack.com/current?access_key=YOUR-API-KEY-HERE' WEATHER_PARAMS = {'query':'Cape Town'} Weather = requests.get(WEATHER_URL,params=WEATHER_PARAMS) If __name__ == '__main__': app.run() # Run the application.

    #APIs #Currency Exchange #Finance 8 social mentions

  2. Gunicorn is a Python WSGI HTTP Server for UNIX.
    Pricing:
    • Open Source
    Gunicorn is a WSGI server that will help serve our Python application (the API hosted on Code Capsules).

    #Web And Application Servers #Web Servers #Application Server 31 social mentions

Discuss: Creating and Hosting a Personal API with Flask and Code Capsules

Log in or Post with