Desearch API SDK

    Introduction

    The Desearch API provides powerful AI-powered search capabilities that can be easily integrated into your applications. To simplify integration and reduce boilerplate code, we offer official SDK implementations for the most popular programming languages.

    Our SDKs provide:

    • Type safety: Full TypeScript/Python type definitions for all API responses
    • Error handling: Consistent error handling across all endpoints
    • Authentication: Simplified API key management
    • Convenience methods: Helper functions for common use cases
    • Documentation: Inline documentation and examples

    Supported Languages

    We currently offer official SDK implementations for the following languages:

    Python SDK

    Our Python SDK is ideal for:

    • Data science and machine learning applications
    • Backend services and APIs
    • Automation scripts and bots
    • Jupyter notebook integrations
    • AI agent frameworks (LangChain, LlamaIndex, CrewAI)

    Key features:

    • Async client support with asyncio
    • Pydantic models for type validation
    • Compatible with Python 3.8+
    • Easy integration with popular frameworks

    View Python SDK Documentation →

    JavaScript/TypeScript SDK

    Our JavaScript SDK is perfect for:

    • Node.js backend applications
    • React, Vue, or Angular frontends
    • Serverless functions (AWS Lambda, Vercel, Cloudflare Workers)
    • Browser-based applications
    • Full-stack TypeScript projects

    Key features:

    • Full TypeScript support with type definitions
    • Works in both Node.js and browser environments
    • Promise-based async API
    • Tree-shakeable for optimal bundle size

    View JavaScript SDK Documentation →

    Quick Comparison

    FeaturePython SDKJavaScript SDK
    Async Support✅ asyncio✅ Promises
    Type Safety✅ Pydantic✅ TypeScript
    Browser Support
    Node.js Support
    Framework IntegrationsLangChain, LlamaIndexReact, Vue, Next.js

    Common Features

    Both SDKs support all Desearch API endpoints:

    Search Endpoints

    • AI Contextual Search: Multi-source semantic search with optional AI-generated summaries
    • AI Web Links Search: Raw link search across web sources without AI summaries
    • AI X Posts Links Search: AI-powered X (Twitter) post link search
    • X Search: Advanced X (Twitter) search with extensive filtering options
    • SERP Web Search: Paginated web search replicating a typical search engine

    X (Twitter) Data Endpoints

    • Fetch Posts by URLs: Retrieve full post data for a list of X post URLs
    • Retrieve Post by ID: Fetch a single X post by its unique ID
    • Search X Posts by User: Search posts from a specific user with optional keyword filtering
    • Get Retweeters of a Post: List users who retweeted a specific post
    • Get X Posts by Username: Retrieve a user's timeline posts
    • Fetch User's Tweets and Replies: Fetch tweets and replies from a specific user
    • Retrieve Replies for a Post: Fetch replies to a specific X post

    Web Crawling

    • Crawl a URL: Fetch page content as plain text or HTML

    Getting Started

    Step 1: Get Your API Key

    Before using any SDK, you'll need a Desearch API key:

    1. Visit console.desearch.ai
    2. Create an account or sign in
    3. Navigate to API Keys section
    4. Generate a new API key
    5. Copy and securely store your key

    Step 2: Choose Your SDK

    Select the SDK that matches your development environment:

    Step 3: Install and Configure

    Follow the installation instructions in your chosen SDK's documentation. Both SDKs can be installed via their respective package managers:

    Python:

    bash
    pip install desearch-py

    JavaScript:

    bash
    npm install desearch-js # or yarn add desearch-js

    Step 4: Make Your First Request

    Python:

    python
    import asyncio from desearch_py import Desearch async def main(): async with Desearch(api_key="your_api_key") as desearch: result = await desearch.ai_search( prompt="Latest developments in AI", tools=["web", "twitter", "reddit"], ) print(result) asyncio.run(main())

    JavaScript:

    typescript
    import Desearch from "desearch-js"; const desearch = new Desearch("your-api-key"); desearch .aiSearch({ prompt: "Latest developments in AI", tools: ["web", "twitter", "reddit"], }) .then((response) => { console.log(response); });

    Support and Resources

    Choosing the Right SDK

    Use Python SDK if:

    • You're building ML/AI applications
    • You need integration with pandas, numpy, or scikit-learn
    • You're using LangChain or LlamaIndex
    • You're running automation scripts
    • You prefer async Python code patterns

    Use JavaScript SDK if:

    • You're building web applications
    • You need browser compatibility
    • You're using Node.js for backend
    • You want TypeScript type safety
    • You're building serverless functions

    Both SDKs are maintained and updated regularly to support new API features and improvements. Check the respective documentation pages for version history and changelog information.

    🍪 We value your privacy

    We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. Read our Privacy Policy