Ever wondered how your website could perform better in terms of speed and user experience? Look no further! We are excited to present Speedmi, a comprehensive website speed analyzer that extracts vital performance data from web pages and stores it in a PostgreSQL database for further analysis. 📊
- ✅ Extracts URLs from a sitemap XML file
- ✅ Processes each URL using Google PageSpeed Insights API
- ✅ Collects various performance, accessibility, best practices, and SEO metrics
- ✅ Saves the metrics to a PostgreSQL database
- 1️⃣ Create a PostgreSQL database and table
- 2️⃣ Set up environment variables for your database credentials and Google PageSpeed API Key
- 3️⃣ Run the script by providing your sitemap URL
CREATE TABLE site_speed_scores (
id SERIAL PRIMARY KEY,
url VARCHAR(2083) NOT NULL,
timestamp TIMESTAMP,
performance_score NUMERIC,
accessibility_score NUMERIC,
best_practices_score NUMERIC,
seo_score NUMERIC,
first_contentful_paint_score NUMERIC,
first_meaningful_paint_score NUMERIC,
largest_contentful_paint_score NUMERIC,
speed_index_score NUMERIC,
cumulative_layout_shift_score NUMERIC,
server_response_time_score NUMERIC,
is_crawlable_score NUMERIC,
console_errors_score NUMERIC,
total_byte_weight_score NUMERIC,
dom_size_score NUMERIC,
raw_json_data JSONB
);
export DB_USER=
export DB_PASS=
export DB_HOST=
export DB_PORT=
export DB_NAME=postgres
export GOOGLE_SPEED_API_KEY=
python speedmi.py "https://example.com/sitemap.xml"
- ✨ Test