How do i get data from external API into cosmos db?

NickKhoo-7526 31 Reputation points


I am exploring cosmos db as a data to store data that will be collected from public APIs from the internet. I am new to this technology. How do I get those data into cosmos db?

Appreciate it if anyone can provide some guidance.



Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,264 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sajeetharan 856 Reputation points Microsoft Employee

    If I understand your question right, you have a data from an external API and want to write the data to Azure Cosmos DB? You can use SDK/Drivers to connect to the Cosmos DB account depending on the API type and use the language of your choice to write code that fetches data from the external API. After fetching data from the external API, parse and transform it as needed to match the data model you've defined in your Cosmos DB collection. Rest of the logic remains the same as how you would write/insert data to Cosmos DB.

  2. Rumen Krastev 0 Reputation points Microsoft Employee

    Concretely, to add what Sajeetharan says, you're going to need a trigger (could be scheduled too), which upon event/time get the data from public API and save it to Cosmos. Here're some helpers:

    If you prefer videos, here's one:

    0 comments No comments