Dappier Python Real Time Data
This template demonstrates how to use Dappier’s Real Time Data models in a Python project. You can check out the app on Replit here: Check out the app on ReplitWatch the Video Guide
If you prefer a visual walkthrough, check out the accompanying video guide below:Getting Started
- Sign up for a Dappier account: https://platform.dappier.com/sign-in
- Create an API key:
- Go to your profile and click “API Keys”
- Click “Create API key”
- Add the API key as a secret in Replit:
- Go to the Secrets Tool
- Add a new secret called
DAPPIER_API_KEYand paste your API key
- Run the code:
- Click the “Run” button in the top right corner
Usage
Python
Parameters
query (str):
- The user-provided query. Examples include:
"How is the weather today in Austin, TX?""What is the latest news for Meta?""What is the stock price for AAPL?"
ai_model_id (str):
- The AI model ID to use for the query.
- AI model IDs always start with the prefix
"am_". - Multiple AI model IDs are available, which can be found at Dappier marketplace.
Dappier Python AI Recommendations
This template demonstrates how to use Dappier’s AI Recommendations models in a Python project. Check out the app on Replit here: Check out the app on ReplitWatch the Video Guide
If you prefer a visual walkthrough, check out the accompanying video guide below:Getting Started
- Sign up for a Dappier account: https://platform.dappier.com/sign-in
- Create an API key:
- Go to your profile and click “API Keys”
- Click “Create API key”
- Add the API key as a secret in Replit:
- Go to the Secrets Tool
- Add a new secret called
DAPPIER_API_KEYand paste your API key
- Run the code:
- Click the “Run” button in the top right corner
Usage
Python
Parameters
query (str):
- The user query for retrieving recommendations.
data_model_id (str):
- The data model ID to use for recommendations.
- Data model IDs always start with the prefix
"dm_".
similarity_top_k (int) Optional:
- The number of top documents to retrieve based on similarity.
- Defaults to
9.
ref (str) Optional:
- The site domain where AI recommendations should be displayed.
- Defaults to
None.
num_articles_ref (int) Optional:
- The minimum number of articles to return from the specified reference domain (
ref). - The remaining articles will come from other sites in the RAG model.
- Defaults to
0.
search_algorithm (str) Optional:
- The search algorithm to use for retrieving articles.
- Options:
"most_recent"(default),"semantic","most_recent_semantic","trending".

