SmartSERP is a Python interface for interacting with the Google Custom Search API, designed to automate and simplify web search requests for real-time SERP results. It provides advanced customization by automatically parsing search parameters—such as SafeSearch, file type, and site restrictions—from natural language prompts in English, Italian, French, and Spanish. If no specific language or filter is mentioned, the tool defaults to the global settings defined in the valves.
date_restrict valve or prompt.If a user does not specify a language or date restriction in the prompt, the tool will use the values configured in the valves.
Prompt Format:
Prompts can be entered as plain text or enclosed in single backticks (e.g., `Find PDF files about climate change`) for clarity and to avoid formatting issues. Both formats are supported.
Supported searchType Values:
Only "image" is supported as a searchType parameter in the Google Custom Search API. Prompts requesting "news" or "video" results will perform a standard web search without specifying searchType to avoid API errors.
Date Restrictions Priority:
Date restrictions extracted from the prompt take precedence over the date_restrict valve setting.
File Type Filtering:
File type filters are applied by appending filetype:<ext> directly to the search query for accurate Google API behavior.
Search for "artificial intelligence" with safe search on.Find PDF files about "climate change".Show results only from site "example.com".Exclude site "fake-news.com" in search for "green technology".Find images of cute cats with safe search off.Latest news about "space exploration" published last month. (Note: news queries run as web search)Cerca articoli su "energia rinnovabile" con SafeSearch attivo.Trova file PDF riguardanti "cambiamenti climatici".Mostrami risultati solo dal sito example.com.Escludi il sito "notiziefalse.com" nelle ricerche su "tecnologie verdi".Cerca immagini di gatti divertenti senza filtro contenuti espliciti.Notizie dal sito "ansa.it" sugli eventi politici italiani dell'ultima settimana. (Nota: le ricerche notizie sono eseguite come ricerca web)Recherche des articles sur "énergie renouvelable" avec SafeSearch activé.Trouve des fichiers PDF concernant le "changement climatique".Montre les résultats uniquement du site example.com.Exclure le site "faussesinfos.com" pour la recherche sur "technologies vertes".Cherche des images de chats mignons sans filtre contenu explicite.Dernières nouvelles sur "exploration spatiale" publiées le mois dernier. (Note : les recherches de news sont des recherches web)Busca artículos sobre "energía renovable" con SafeSearch activado.Encuentra archivos PDF sobre "cambio climático".Muestra resultados solo del sitio "ejemplo.com".Excluir el sitio "noticiasfalsas.com" en la búsqueda de "tecnologías verdes".Busca imágenes de gatos divertidos sin filtro contenido explícito.Últimas noticias sobre "exploración espacial" publicadas el mes pasado. (Nota: las búsquedas de noticias se realizan como búsqueda web)Google Custom Search API has a daily request quota and may incur costs depending on your usage. Monitor your API usage to avoid exceeding your quota or incurring unexpected charges.
For optimal performance and compatibility with this tool, we recommend using the following model from Hugging Face:
Models:
This project is licensed under the MIT License.
Open WebUI Enterprise — White-labeling, SSO, and dedicated support for your team.