Statsify REST API
Statsify is a web application that allows you to view beautiful statistics and info about the web pages and websites you visit, with insights such as the following:
• Ratio of internal vs. outbound links
• Most frequent words
• Key phrases
• Total word count
• Most frequent pages
• And more...
Statsify is available in three formats: a website, a chrome extension, and a public API.
To install the Statsify API locally, type the following into your command line:
git clone https://github.com/alankbi/statsify-api.git cd statsify-api # Recommended to create a virtual environment first pip install -r requirements.txt
A list of the requirements can be found here.
To run the Statsify API on Flask's development server, you can use the following:
To run using gunicorn:
With multiple workers:
gunicorn api:app --workers 2
Once your local server is running, you can now access the API at
localhost:PORT. For details about the API endpoints, see here.
Usage Tracking Configuration
Your API usage statistics can be seen at
/dashboard/overview. To configure the admin password or the path to your database (such as if you wanted to use PostgreSQL instead of the default SQLite), you can set the
STATSIFY_DB_URL environment variables to your machine; when run, the api.py file creates the config.cfg file from these values in order to keep them hidden from commit history. For more details about the dashboard, see here.
Feel free to submit an issue or pull request if you find a bug or would like to add a feature. If you're adding large amounts of code, please be sure to include unit tests as well.
Please reach out to me at firstname.lastname@example.org if you have any questions or feedback!