Skip to content

ChiragArora31/API-Talks

Repository files navigation

API-Talks πŸš€

An AI-powered conversational API explorer that helps developers interact with APIs through natural language queries.

Next.js TypeScript Tailwind CSS Google Gemini

✨ Features

  • πŸ€– AI-Powered Responses: Uses Google Gemini 2.5 Flash for intelligent, context-aware responses
  • πŸ’¬ Natural Language Interface: Ask questions in plain English about any API
  • πŸ” RAG-Powered Search: Retrieval-Augmented Generation for accurate, relevant responses
  • πŸ’» Code Generation: Get ready-to-run code snippets with proper syntax highlighting
  • 🎨 Modern UI/UX: Beautiful, minimalistic interface with light/dark theme support
  • 🌐 10+ API Platforms: Comprehensive support for popular APIs
  • ⚑ Real-time: Instant responses with fast vector search

🎯 Supported APIs

  • GitHub - Repositories, search, issues, pull requests, and more
  • YouTube - Videos, channels, playlists, comments, and more
  • Spotify - Tracks, artists, albums, playlists, search, and more
  • Twitter/X - Tweets, users, timelines, and more
  • Google Maps - Geocoding, places, directions, and more
  • Stripe - Payments, customers, subscriptions, and more
  • OpenAI - Chat completions, embeddings, fine-tuning, and more
  • OpenWeatherMap - Weather data, forecasts, and more
  • Notion - Pages, databases, blocks, and more
  • Reddit - Posts, comments, subreddits, and more

πŸ—οΈ Architecture

RAG System (Retrieval-Augmented Generation)

User Query β†’ Embedding β†’ Vector Search β†’ Relevant Docs β†’ LLM β†’ Response
  1. Retrieval: Semantic search across API documentation using vector embeddings
  2. Augmentation: Context injection with most relevant documentation
  3. Generation: LLM generates responses using query + retrieved context

Tech Stack

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • AI: Google Gemini 2.5 Flash
  • Vector Store: File-based with cosine similarity search
  • Syntax Highlighting: React Syntax Highlighter

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm/yarn
  • Google Gemini API key (free tier available)

Installation

  1. Clone the repository

    git clone https://github.com/ChiragArora31/API-Talks.git
    cd API-Talks
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env.local file in the root directory:

    GEMINI_API_KEY=your_gemini_api_key_here

    Get your free API key from Google AI Studio

  4. Run the development server

    npm run dev
  5. Open your browser

    Navigate to http://localhost:3000

πŸ“– Usage

  1. Ask questions naturally

    • "How to generate embeddings using OpenAI API?"
    • "Show me how to search for tracks using Spotify API"
    • "How do I create a payment intent with Stripe?"
  2. Get instant responses

    • Contextual explanations
    • Ready-to-run code snippets
    • Properly formatted and highlighted
  3. Toggle themes

    • Click the theme toggle button (top right)
    • Switch between light and dark modes

πŸ“ Project Structure

API-Talks/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ chat/                    # Chat API endpoint
β”‚   β”‚   └── init-vector-store/       # Vector store initialization
β”‚   β”œβ”€β”€ globals.css                  # Global styles
β”‚   β”œβ”€β”€ layout.tsx                   # Root layout with theme provider
β”‚   └── page.tsx                     # Home page
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ChatInterface.tsx            # Main chat UI component
β”‚   β”œβ”€β”€ ThemeProvider.tsx             # Theme context provider
β”‚   └── ThemeToggle.tsx               # Theme toggle button
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ documentation-fetcher.ts     # API documentation fetcher
β”‚   β”œβ”€β”€ embedding-service.ts         # Vector embedding generator
β”‚   β”œβ”€β”€ vector-store.ts              # Vector database
β”‚   β”œβ”€β”€ rag-service.ts               # RAG orchestration
β”‚   β”œβ”€β”€ code-generator.ts            # Code snippet generator
β”‚   └── llm-service.ts               # LLM integration
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
└── README.md

πŸ”§ Configuration

Vector Store

The vector store is automatically initialized on first use. It stores embeddings for all API documentation in .vector-store.json (git-ignored).

To manually reinitialize:

# Via API
curl -X POST http://localhost:3000/api/init-vector-store

Environment Variables

  • GEMINI_API_KEY - Required for AI-powered responses
  • Without API key, the app will show an error (API key is required)

πŸ› οΈ Development

Build for Production

npm run build
npm start

Run Linting

npm run lint

🎨 UI Features

  • Modern Design: Clean, minimalistic interface
  • Theme Support: Light and dark modes with smooth transitions
  • Code Highlighting: Professional syntax highlighting for code blocks
  • Responsive: Works seamlessly on desktop and mobile
  • Copy to Clipboard: One-click code copying

πŸ”’ Security

  • Never commit .env.local or API keys
  • Vector store file (.vector-store.json) is git-ignored
  • All sensitive files are excluded via .gitignore

🀝 Contributing

Contributions are welcome! Feel free to:

  • Add support for more APIs
  • Improve code generation logic
  • Enhance UI/UX
  • Add new features
  • Fix bugs

πŸ“ License

MIT License - feel free to use this project for personal or commercial purposes.

πŸ™ Acknowledgments

πŸ“§ Contact

For questions or suggestions, please open an issue on GitHub.


Made with ❀️ for developers

About

AI-powered conversational API explorer

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published