API Clients
Glean offers official API clients for several popular programming languages to help developers integrate Glean's powerful search and knowledge capabilities into their applications. These clients provide language-specific interfaces to Glean's APIs, making it easier to build custom solutions without having to handle the low-level HTTP requests.
Authentication Required: You'll need API tokens to use these libraries. Get Client API tokens for search and chat features, or Indexing API tokens for document management.
Unified Libraries: These API clients support both Client API and Indexing API functionality. Use the same library with different tokens depending on whether you're building user-facing features (Client API) or managing document indexing (Indexing API).
Choose Your Language
Select your preferred programming language to get started with the official Glean API client:
Python
Full-featured Python client with framework integrations for FastAPI, Django, and Streamlit
TypeScript
Type-safe client for Node.js and browser applications with React, Next.js, and Express examples
Go
Idiomatic Go client with concurrency patterns and framework integrations for Gin and Echo
Java
Enterprise-ready Java client with Spring Boot integration and reactive programming support
What's Included
All official API clients provide:
Client API Features
- Chat API: Build conversational AI applications
- Search API: Integrate enterprise search capabilities
- Agents API: Execute pre-built agents from Agent Builder
- Collections API: Manage and search document collections
Indexing API Features
- Document Management: Index, update, and delete documents
- User Management: Manage users, groups, and permissions
- Datasource Configuration: Set up and configure data sources
- Bulk Operations: Efficient batch processing for large datasets
Developer Experience
- Type Safety: Full type definitions and IntelliSense support
- Error Handling: Structured error responses and retry mechanisms
- Framework Integration: Examples for popular web frameworks
- Testing Support: Mock examples and integration test patterns
- Documentation: Comprehensive guides with real-world examples
Production Ready
- Rate Limiting: Automatic handling with exponential backoff
- Timeout Control: Configurable request timeouts
- Connection Pooling: Efficient HTTP connection management
- Security: Best practices for token management
Getting Started
- Choose your language from the cards above
- Follow the installation instructions for your package manager
- Get your credentials:
- Client API tokens for search and chat features
- Indexing API tokens for document management
- Start building with the provided examples
Alternative Integration Options
If you prefer not to use an API client library:
Direct HTTP Requests
Use Glean's REST APIs directly with your preferred HTTP library
Web SDK
Frontend JavaScript components for search and chat interfaces