Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

FYI : Your API key will be throttled at 100 request in a day, please plan accordingly.

You are expected to build the following functionality :

1. Goals
a. Create an API to give a list of all sources of news available for a user based on
the selected_category and selected_country in the user profile. You need to
integrate with https://newsapi.org/docs/endpoints/sources to get all sources.
b. Modify the API you created for creating the user to also save a list of preferred
source that the user will enter. Validate that the chosen sources are actually valid
for the combination of country and category that the user has chosen
2. Stretch Goal
a. Modify the API created to get news articles (goal 1(b) from yesterday’s
assignment) to get news articles from chosen sources only if this is set in the
user profile else fallback to the logic shared in yesterday’s assignment.
b. Add support for from and to date in the above API to get top news articles. Throw
an exception if people are requesting for articles from the last 30 days.

Please Note that :

1. You need to independently demonstrate all goals 1(a), 1(b), 2(a), 2(a) and 2(b).
Either create separate endpoints or keep git history in such a way that you can go to
an old commit.
2. Lab instructors will not be available to help you out in the assignment
3. Use your judgement and structure the code in a way that is understandable (use
proper variable names, API names etc.)
4. Try to finish the assignment by 6:45 PM - 7:00 PM. An instructor will grade you post
that
5. If you are unable to finish some goals, demonstrate what you have done, rest you
can demonstrate tomorrow along with the assignment for tomorrow.
6. For data persistence , any in memory data structure.

You might also like