Skip to main content

A Python SDK for interacting with the Desearch API service.

Project description

Desearch

Desearch API in Python

https://console.desearch.ai/

Installation

pip install desearch-py

Usage

Import the package and initialize the Desearch client with your API key:

    from desearch_py import Desearch

    desearch = Desearch(api_key="your-api-key")

Common requests

    
    # Desearch AI Search
    result = desearch.ai_search(
        prompt="Bittensor",
        tools=[
            "web",
            "hackernews",
            "reddit",
            "wikipedia",
            "youtube",
            "twitter",
            "arxiv"
        ],
        date_filter="PAST_24_HOURS",
        streaming=False,
        result_type="LINKS_WITH_SUMMARIES",
        system_message="",
        count=10,
    )

    #Desearch Twitter post search
    result = desearch.twitter_links_search(
        prompt="Bittensor", 
        count=10,
    )

    #Desearch Web links search
    result = desearch.web_links_search(
        prompt="Bittensor",
        tools=[
            "web",
            "hackernews",
            "reddit",
            "wikipedia",
            "youtube",
            "arxiv"
        ],
        count=10,
    )

    #Basic Twitter search
    result = desearch.basic_twitter_search(
        query="Whats going on with Bittensor",
        sort="Top",
        user="elonmusk",
        start_date="2024-12-01",
        end_date="2025-02-25",
        lang="en",
        verified=True,
        blue_verified=True,
        is_quote=True,
        is_video=True,
        is_image=True,
        min_retweets=1,
        min_replies=1,
        min_likes=1,
        count=10
    )

    #Basic Web search
    result = desearch.basic_web_search(
        query="latest news on AI",
        num=10,
        start=0
    )

    #Web crawl
    result = desearch.web_crawl(
        "https://docs.desearch.ai/docs/desearch-api"
    )

    #Fetch Tweets by URLs
    result = desearch.twitter_by_urls(
        urls=["https://twitter.com/elonmusk/status/1613000000000000000"]
    )

    #Fetch Tweets by ID
    result = desearch.twitter_by_id(id="123456789")

    #Fetch Tweets by User
    result = desearch.tweets_by_user(
        user="elonmusk",
        query="Bittensor",
        count=10
    )

    #Fetch Latest Tweets
    result = desearch.latest_tweets(
        user="elonmusk",
        count=10
    )

    #Fetch Tweets and Replies by User
    result = desearch.tweets_and_replies_by_user(
        user="elonmusk",
        query="Bittensor",
        count=10
    )

    #Fetch Replies by Post
    result = desearch.twitter_replies_post(
        post_id="123456789",
        count=10
        query="Bittensor"
    )

    #Fetch Retweets by Post
    result = desearch.twitter_retweets_post(
        post_id="123456789",
        count=10,
        query="Bittensor"
    )

    #Fetch Tweeter User
    result = desearch.tweeter_user(
        user="elonmusk")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

desearch_py-1.0.9.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

desearch_py-1.0.9-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file desearch_py-1.0.9.tar.gz.

File metadata

  • Download URL: desearch_py-1.0.9.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for desearch_py-1.0.9.tar.gz
Algorithm Hash digest
SHA256 47bebd0e2685883a7b2c84b53d16abe818d56eb824b0f3d3e3f0f101978c65ed
MD5 9b9c853639d80970cf463bd923ef0190
BLAKE2b-256 16232226b41942d6fb7fc051631a9cdad344f0860133a16cd42d39ce9adf12d7

See more details on using hashes here.

File details

Details for the file desearch_py-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: desearch_py-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for desearch_py-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c0e05bdd4dd656b15c1f07598b11228892f22164f69f5147b7b7443cce817d70
MD5 aa9c2e82d693a92d026e9149a6d2d876
BLAKE2b-256 5c8ea68d08a6ed8a6d8b825e9c83137005b2eb2a5e8353d1f56ad90a59bad6c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page