⚡ Live Interactive Code Sandbox: AI Dev Tool: Kagi added a setting
▶️ Run Code
💳 Unlock Source Code ($5)
📝 Editable Code Sandbox
```python # AI Dev Tool: FastAPI Supabase Search Filter # ============================================ # A production-ready boilerplate for building fast and scalable search filters # using FastAPI and Supabase. from fastapi import FastAPI, HTTPException from fastapi.responses import JSONResponse from pydantic import BaseModel from supabase import create_client, Client from typing import List, Optional # Initialize FastAPI app app = FastAPI() # Initialize Supabase client SUPABASE_URL = "https://your-supabase-instance.supabase.co" SUPABASE_KEY = "your-supabase-key" SUPABASE_SECRET = "your-supabase-secret" supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY) # Define search filter model class SearchFilter(BaseModel): query: str remove_paywalled: bool = False # Define search result model class SearchResult(BaseModel): id: int title: str link: str paywalled: bool # Search filter endpoint @app.post("/search", response_model=List[SearchResult]) async def search(filter: SearchFilter): """ Search for links based on the given query and filter options.
🖥️ Interactive Execution Terminal Console
⚡ Ready! Click ▶️ Run Code to execute code in browser terminal...