Skip to main content

CLI + API for Google PageSpeed Insights

Project description

PyPSI

CLI 🖥 + API for Google PageSpeed Insights

PythonPSI PyPI - Downloads

PyPSI

Installation

pip install PythonPSI

Usage

psi <SITE_URL> <OPTION1> <OPTION2> ...

Example:

psi google.com --category seo --stratergy desktop --locale en

Arguments

  • URL - Required
  • --api_key - Optional, default: None, description: Required to use the API in an automated way and make multiple requests per second. Learn more.
  • --category - Optional, default: performance, description: A Lighthouse category to run; if none are given, only Performance category will be run
  • --locale - Optional, default: en, description: The locale used to localize formatted results
  • --stratergy - Optional, default: desktop, description: The analysis strategy (desktop or mobile) to use, and desktop is the default
  • --utm_campaign - Optional, default: None, description: Campaign name for analytics.
  • --utm_source - Optional, default: None, description: Campaign source for analytics.
  • --captcha_token - Optional, default: None, description: The captcha token passed when filling out a captcha.

API Usage

from PythonPSI.api import PSI

PSI('google.com', category='seo', locale='en', stratergy='desktop')
# Returns JSON output
  • PSI - Required arguments: 1, Optional arguments: 7
    • URL: Required
    • api_key: Optional
    • category: Optional
    • locale: Optional
    • stratergy: Optional
    • utm_campaign: optional
    • utm_source: Optional
    • captcha_token: Optional

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PythonPSI-1.5.0.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

PythonPSI-1.5.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page