This dbt project transforms raw YouTube API data from a central analytics data source into clean, tested, and documented data models for analyzing video performance, content types, and viewer engagement across multiple channels.
This warehouse powers reporting, dashboards, and analysis that answer key questions like:
- Which videos or content types drive the most engagement?
- How do tags, promos, or highlights perform across channels?
- What videos are performing best by upload day, time, or topic?
This project is built on top of a single data source:
raw_youtube
(viastage_youtube_api_metrics
)- Powered by the YouTube Data API
- Contains raw video, channel, and metric-level fields
The project follows modern dimensional modeling and dbt best practices:
models/ ├── staging/ ├── dimensions/ ├── bridge/ ├── facts/ └── reports/
stage_youtube_api_metrics
: Prepares raw YouTube API data
dim_video
: Video metadata and flags likeis_short
,is_full_match
dim_channel
: Channel-level info (name, subscribers)dim_date
: Standard date dimension for joining with fact tablesdim_tag
: Unique video tags extracted from metadata
bridge_video_tag
: Many-to-many relationship between videos and tags
fact_video_daily_performance
: Core metrics like views, likes, and engagement rate
report_video_daily_performance
: Flattened report-friendly view of daily video metricsreport_tag_daily_performance
: Tag-level attribution of engagement metrics
Data quality is validated using dbt tests, including:
- Unique & not null constraints on surrogate keys
- Relationship tests between fact & dimension models
- Optional accepted values or derived content-type classifications
Generate interactive documentation using:
Preview details about each model, column, tests, and relationships via the dbt Docs UI.
Typical workflow:
dbt run # Build all models dbt test # Run all data quality tests dbt docs generate # Build documentation site dbt docs serve # Launch doc site at http://localhost:8080/
Models are organized using tags like:
dimension
,fact
,bridge
,report
,stage
Materializations are configured in dbt_project.yml
:
- Dimensions:
table
- Fact/Report Tables:
table
- Staging Models:
view
To contribute:
- Fork the repo or work in a feature branch
- Add your model or update existing logic
- Run
dbt test
anddbt docs generate
before submitting a PR
Feel free to reach out to Grapple Insights.
Made with ❤️ and dbt. Powered by the YouTube Data API.
- Learn more about dbt in the docs
- Check out Discourse for commonly asked questions and answers
- Join the dbt community to learn from other analytics engineers
- Find dbt events near you
- Check out the blog for the latest news on dbt's development and best practices