Coder Social home page Coder Social logo

rishabkumar7 / speedtest-api Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 100 KB

A Web API built with flask to perform internet speed test.

Home Page: https://speedtest.rishab.cloud

License: MIT License

Python 40.82% HTML 54.47% Dockerfile 4.71%
api flask python python3

speedtest-api's Introduction

Flask Speedtest API

This is a Flask app that provides an API for running a speedtest and returning the download and upload speeds in Mbps. The app also includes an index page with a button to run the speedtest and display the results.

Prerequisites

  • Python 3.6 or higher
  • Flask
  • speedtest-cli

Installation

  1. Clone this repository:
git clone https://github.com/rishabkumar7/speedtest-api.git`

2.Install the required packages:

pip install -r requirements.txt

3.Run the app:

python app.py

4.Visit http://localhost:5000 in your web browser to view the index page.

Usage

To run the speedtest and get the results in JSON format, make a GET request to the /speedtest endpoint. For example:

curl http://localhost:5000/speedtest

The response will be in JSON format and will include the download and upload speeds in Mbps:

{
  "download_speed": 25.56,
  "upload_speed": 10.23
}

To view the index page, visit the root URL http://localhost:5000. Click the "Run Speedtest" button to start the speedtest and display the results.

Deployment

This app can be deployed to a cloud hosting platform such as AWS, Azure, or GCP.

Credits

This app uses the speedtest-cli library for running the speedtest. The animated GIF used for the loading spinner was sourced from Giphy.

License

This project is licensed under the MIT License. See the LICENSE file for details.

speedtest-api's People

Contributors

rishabkumar7 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

abhiraj2310

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.