Introduction
In this step-by-step guide, we will walk you through building a Sports News Summarizer using Replit and Dappierβs AI Recommendations API. This app will fetch the latest sports news from trusted sources using Dappierβs AI-powered content recommendations and generate concise news summaries using OpenAIβs AI models. With real-time data and AI-driven summarization, users can quickly stay updated on trending sports events.Dappier AI Recommendations API
This template demonstrates how to a Build a Sports News Summarizer Using Replit and Dappier AI Recommendations API. 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:Dappier AI Recommendations API
The Dappier AI Recommendations API uses the following endpoint:Usage in Python
The API can be used to fetch the latest sports news with a simple function call:Parameters
- query (str): The user-provided search query (e.g.,
"latest sports news"). - data_model_id (str): The Sports News Model ID from the Dappier Marketplace.
- similarity_top_k (int): The number of articles to return (default:
9). - ref (str): The domain to prioritize (e.g.,
"sportsnaut.com"). - num_articles_ref (int): The number of guaranteed articles from the chosen domain.
- search_algorithm (str):
"semantic"for contextual matching or"most_recent"for sorting by latest articles.
Prerequisites
Before you begin, ensure you have:- A Dappier account (Sign up here)
- An OpenAI account (Sign up here)
- A Replit account (Sign up here)
Step 1: Fork the Dappier Python AI Recommendations App
- Visit the Dappier Replit Integration Documentation.
- Click on the Dappier Python AI Recommendations link inside the page to open the template in Replit.
- Fork the app to create your own version.
- Rename the app to Dappier Sports News Summarizer.
- Add a detailed description such as:
βA Sports News Summarizer that fetches the latest sports updates from Dappierβs AI-powered news recommendations and summarizes them using OpenAIβs AI models.β
Step 2: Set Up API Keys
1. Add the Dappier API Key
- Go to Dappier API Keys.
- Generate an API key.
- In Replit, open the Secrets Manager.
- Add a new secret:
- Key:
DAPPIER_API_KEY - Value: (Paste your Dappier API Key here)
- Key:
- Click Save.
2. Add the OpenAI API Key
- Go to OpenAI API Keys.
- Generate an API key.
- In Replit, open the Secrets Manager.
- Add a new secret:
- Key:
OPENAI_API_KEY - Value: (Paste your OpenAI API Key here)
- Key:
- Click Save.
Step 3: Run the App
- Click βRunβ in Replit to check if everything is working correctly.
- The system will automatically install dependencies and generate necessary code for you.
- Accept any suggested changes by Replit.
Step 4: Generate the Sports News Summarizer Using Replitβs AI Assistant
Instead of writing the code manually, Replitβs AI Assistant can generate the entire app for you by following these simple instructions:- Open the Assistants App in Replit.
- Enter the following instructions:
βCreate a Sports News Summarizer app that retrieves the latest sports updates from Dappierβs AI-powered news recommendations. Use the Sports News data model from Dappier to fetch real-time news articles. Then, use OpenAIβs API to summarize the key points of each article. The app should present concise summaries, allowing users to quickly grasp the latest sports highlights.β
- Replitβs AI will automatically generate the code for your app.
- Accept the code suggestions and let Replit set up everything for you.
- Run the app to verify it works as expected.
Step 5: Verify and Deploy
- Run the app again to verify that sports news articles are retrieved and summarized correctly.
- If everything looks good, deploy the app.

