Skip to main content
The Dappier Python SDK provides a simple and efficient way to integrate Dappier’s real-time data capabilities into your Python applications. With this SDK, you can easily access Dappier’s AI models and data models to enhance your applications with live search, financial insights, and domain-specific content. GitHub Repository: Dappier Python SDK

Available Models

Dappier offers two categories of models that can be used within bolt.new applications:
  • Real-Time Search (AI Models): Perform live web and financial queries using natural language.
  • AI Recommendations (Data Models): Retrieve curated, vertical-specific content for domains like pets, lifestyle, and news.
All models are rights-cleared, production-ready, and accessible via the Dappier API.

🔎 Real-Time Search (AI Models)


🤖 AI Recommendations (Data Models)


👉 To learn more about how these models work and how to query them, visit the official API reference:
https://docs.dappier.com/api-reference

Installation

Install the SDK using pip:

Initialization

Set up your API key and initialize the SDK:
Python
Replace <YOUR_API_KEY> with your actual API key, which you can get from your Dappier Account.
Perform a real-time search for live data:
Python

query (string):

  • A natural language query representing the information being searched for in real time.

ai_model_id (string):

  • The ID of the AI model to be used for real-time data search.
  • This must be a valid model ID from the Dappier Marketplace.

AI Recommendations

Retrieve AI-powered content recommendations based on a query:
Python

Parameters (AI Recommendations)

query (string):

  • A natural language query or URL.

data_model_id (string):

  • The ID of the data model to be used for recommendations.
  • This must be a valid model ID from the Dappier Marketplace.

similarity_top_k (integer):

  • The number of articles to return (default is 9).

ref (string):

  • The domain of the site from which the recommendations should come.
  • Example: techcrunch.com.

num_articles_ref (integer):

  • Specifies how many articles should be guaranteed to match the domain specified in ref.
  • Use this to ensure a set number of articles from the desired domain appear in the results.

search_algorithm (string):

  • Options: "most_recent" or "semantic".
  • "semantic" (default): Contextual matching of the query to retrieve articles.
  • "most_recent": Retrieves articles sorted by the most recent publication date.
You can select a specific Data model from the Dappier Marketplace.

Async Functionality

Dappier SDK supports asynchronous operations for better performance.
Python

Parameters (Real Time Search)

query (string):

  • A natural language query representing the information being searched for in real time.

ai_model_id (string):

  • The ID of the AI model to be used for real-time data search.
  • This must be a valid model ID from the Dappier Marketplace.

Async AI Recommendations:

Python
You can select a specific Data model from the Dappier Marketplace. The async SDK version improves performance, especially for large-scale requests.

Parameters (AI Recommendations)

query (string):

  • A natural language query or URL.

data_model_id (string):

  • The ID of the data model to be used for recommendations.
  • This must be a valid model ID from the Dappier Marketplace.

similarity_top_k (integer):

  • The number of articles to return (default is 9).

ref (string):

  • The domain of the site from which the recommendations should come.
  • Example: techcrunch.com.

num_articles_ref (integer):

  • Specifies how many articles should be guaranteed to match the domain specified in ref.
  • Use this to ensure a set number of articles from the desired domain appear in the results.

search_algorithm (string):

  • Options: "most_recent" or "semantic".
  • "semantic" (default): Contextual matching of the query to retrieve articles.
  • "most_recent": Retrieves articles sorted by the most recent publication date.