Official documentation: https://ai.google.dev/gemini-api/docs/url-context?hl=en With the URL context tool, you can provide the model with additional context in the form of URLs. By including URLs in your request, the model will access the content from these webpages (as long as they are not among the restricted types listed), which helps provide information and improve the quality of responses. The URL context tool is suitable for the following tasks:Data extraction: Extract specific information such as prices, names, or key findings from multiple URLs. Document comparison: Analyze multiple reports, articles, or PDFs to identify differences and track trends. Content synthesis and creation: Combine information from multiple source URLs to generate accurate summaries, blog posts, or reports. Code and documentation analysis: Link to GitHub repositories or technical documentation to explain code, generate setup instructions, or answer questions.
Request
Header Params
Body Params application/json
Example
{"contents":[{"role":"user","parts":[{"text":"Interpreting this website https://www.youtube.com/watch?v=QCvF8mCPwdQ"}]}],"tools":[{"UrlContext":{}}]}