The SUGGEST_TITLE function is a custom Google Apps Script function designed for use in Google Sheets. It utilizes the Gemini Vision API to analyze an image from a given URL and generate a descriptive, short title.
SUGGEST_TITLE(imageUrl, language)
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
imageUrl |
String | Yes | The direct URL of the image to analyze. | - |
language |
String | No | The language code for the generated title (e.g., 'en', 'es', 'fr'). | 'en' |
Returns a String containing the suggested title in Title Case.
Possible error returns:
- "No URL provided"
- "Image Access Error: [Code]"
- "Gemini Error: [Message]"
- "⚠️ Blocked: [Reason]"
- "⚠️ Sensitive Content (Censored)"
- "Error: [Exception Message]"
SUGGEST_TITLE function code into the script editor. // 1. Setup
const scriptProperties = PropertiesService.getScriptProperties();
const apiKey = scriptProperties.getProperty('API_KEY');
// Changed to 2.5-flash
const API_URL = `https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-09-2025:generateContent?key=${apiKey}`;
Once the script is saved, you can use the function directly in a cell like any other spreadsheet formula.
Generate a title in English (default):
=SUGGEST_TITLE("https://example.com/my-photo.jpg")
Generate a title in Spanish:
=SUGGEST_TITLE("https://example.com/my-photo.jpg", "es")
You can reference cells containing the URL and language:
=SUGGEST_TITLE(A2, B2)
Where A2 contains the URL and B2 contains the language code.
gemini-2.5-flash-preview-09-2025 model.This project is licensed under the MIT License.
InnovUmabot | https://innovumabot.com
This tool was vibe-coded with AI with strict human supervision.