HeadlinesBriefing favicon HeadlinesBriefing.com

Gemini 3 Fetches Premier League Stats with URL Context

DEV Community •
×

A developer demonstrates how to retrieve accurate Premier League 2025/2026 player statistics using Gemini 3 Flash Preview. The model struggles with outdated training data, so the solution combines URL Context for official profile pages and Google Search grounding for personal details like net worth. A Pydantic schema structures the output to enforce data validation.

The key challenge was the model's tendency to rely on internal knowledge over provided URLs. The solution involved explicit prompt engineering, instructing Gemini to prioritize the official Premier League URLs first, then web citations, and finally its own training data. This dynamic source identification was critical for accuracy.

Another hurdle was unreliable grounding metadata. The initial approach used a chunk ID for verification, but the model often hallucinated invalid indices. The fix shifted the architecture to require the model to cite a specific URI and source quote directly in the JSON response, moving verification from metadata to the data itself.

The final prompt template includes strict rules for URI extraction and source type classification, forcing the model to cite exact URLs. This turns Gemini from a guessing engine into a reader of provided documents. The approach is a practical blueprint for building reliable, citation-backed data retrieval systems with LLMs.