Tutorial

How to Ground a Vibecoded App with Search Data

Add real-time search data to vibecoded apps in 5 minutes. Simple fetch call, parse response, display results. Copy-paste starter code included.

Add real-time search data to a vibecoded app by dropping in an API key, writing a single fetch call, parsing the JSON response, and rendering results in your UI. Vibecoded apps are built fast with AI assistance but often lack real-time data because connecting external APIs feels like a context switch from the vibe coding flow. A search API integration takes under 5 minutes and gives your app access to Google, Amazon, YouTube, Reddit, and Walmart data through one endpoint. No OAuth, no SDK, no complex setup.

Prerequisites

  • A vibecoded app (React, Next.js, Svelte, or any JS framework)
  • A Scavio API key from scavio.dev
  • Basic JavaScript/Python knowledge
  • 5 minutes

Walkthrough

Step 1: Add your API key

Store the Scavio API key in your environment or config. Never hardcode API keys in client-side code.

Python
import os

# In .env file: SCAVIO_API_KEY=your_key_here
# In Python:
API_KEY = os.environ['SCAVIO_API_KEY']

# In Next.js: .env.local
# SCAVIO_API_KEY=your_key_here
# Access via: process.env.SCAVIO_API_KEY (server-side only)

# Verify the key works:
import requests
resp = requests.post('https://api.scavio.dev/api/v1/search',
    headers={'x-api-key': API_KEY},
    json={'platform': 'google', 'query': 'test'}, timeout=10)
print(f'API status: {resp.status_code}')
print(f'Results: {len(resp.json().get("organic_results", []))}')

Step 2: Write the fetch call

One function that searches any platform. Copy this into your app.

Python
import requests, os

API_KEY = os.environ['SCAVIO_API_KEY']

def search(query: str, platform: str = 'google') -> list:
    """Search any platform. Returns list of results."""
    resp = requests.post('https://api.scavio.dev/api/v1/search',
        headers={'x-api-key': API_KEY},
        json={'platform': platform, 'query': query}, timeout=10)
    return resp.json().get('organic_results', [])

# That's it. Use it:
results = search('best python libraries 2026')
print(f'{len(results)} results')

# Search Amazon:
products = search('wireless earbuds', 'amazon')
print(f'{len(products)} products')

# Search YouTube:
videos = search('python tutorial', 'youtube')
print(f'{len(videos)} videos')

Step 3: Parse the response

Extract the fields you need from results. Each result has title, link, and snippet at minimum.

Python
def display_results(results: list, limit: int = 5) -> list:
    """Format results for your UI."""
    formatted = []
    for r in results[:limit]:
        formatted.append({
            'title': r.get('title', ''),
            'url': r.get('link', ''),
            'description': r.get('snippet', ''),
            'price': r.get('price', ''),       # Amazon/Walmart
            'rating': r.get('rating', ''),      # Amazon/Walmart
            'thumbnail': r.get('thumbnail', ''), # YouTube
        })
    return formatted

# Google results
google = display_results(search('best CRM 2026'))
for r in google:
    print(f"{r['title']}: {r['description'][:80]}")

# Amazon products
amazon = display_results(search('laptop stand', 'amazon'))
for r in amazon:
    print(f"{r['title'][:40]}: {r['price']}")

Step 4: Display in your UI

Render the results in your app. Here are patterns for React, Svelte, and plain HTML.

Python
# Python Flask/FastAPI backend route example:
# @app.get('/api/search')
# async def api_search(q: str, platform: str = 'google'):
#     return {'results': display_results(search(q, platform))}

# For a Python CLI app:
def interactive_search():
    print('Search powered by Scavio API')
    print('Platforms: google, amazon, youtube, walmart, reddit\n')
    query = 'best project management tool 2026'
    platform = 'google'
    results = display_results(search(query, platform))
    print(f'\nResults for "{query}" on {platform}:\n')
    for i, r in enumerate(results, 1):
        print(f'{i}. {r["title"]}')
        if r['description']:
            print(f'   {r["description"][:100]}')
        if r['price']:
            print(f'   Price: {r["price"]}')
        print(f'   {r["url"]}')
        print()

interactive_search()

Step 5: Test end-to-end

Verify the integration works across all platforms.

Python
def test_integration():
    platforms = {
        'google': 'best python framework 2026',
        'amazon': 'mechanical keyboard',
        'youtube': 'python tutorial beginners',
        'walmart': 'office chair',
        'reddit': 'best IDE for python',
    }
    for platform, query in platforms.items():
        results = search(query, platform)
        print(f'{platform}: {len(results)} results for "{query}"')
        if results:
            print(f'  Top: {results[0].get("title", "")[:50]}')
    print('\nAll platforms working.')

test_integration()

Python Example

Python
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}

def search(query, platform='google'):
    data = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
        json={'platform': platform, 'query': query}).json()
    return [{'title': r['title'], 'url': r.get('link', ''), 'snippet': r.get('snippet', '')}
        for r in data.get('organic_results', [])[:5]]

# Drop this into any vibecoded app:
print(search('best CRM 2026'))

JavaScript Example

JavaScript
// Drop this into any vibecoded app:
const SCAVIO_KEY = process.env.SCAVIO_API_KEY;
async function search(query, platform = 'google') {
  const r = await fetch('https://api.scavio.dev/api/v1/search', {
    method: 'POST',
    headers: {'x-api-key': SCAVIO_KEY, 'Content-Type': 'application/json'},
    body: JSON.stringify({platform, query})
  });
  return ((await r.json()).organic_results || []).slice(0, 5)
    .map(r => ({title: r.title, url: r.link, snippet: r.snippet}));
}
search('best CRM 2026').then(console.log);

Expected Output

JSON
A vibecoded app with real-time search data from Google, Amazon, YouTube, Reddit, and Walmart through a single API integration that took under 5 minutes.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

A vibecoded app (React, Next.js, Svelte, or any JS framework). A Scavio API key from scavio.dev. Basic JavaScript/Python knowledge. 5 minutes. A Scavio API key gives you 250 free credits per month.

Yes. The free tier includes 250 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Add real-time search data to vibecoded apps in 5 minutes. Simple fetch call, parse response, display results. Copy-paste starter code included.