sounds good i ll share some info to set
sounds good i'll share some info to set that up when you'll work on it
2 Replies
some info / steps helpful to setup an ingestion service
1. The libraries you can use for this purpose include
5. Set Up Scheduler: With
6. API Pagination: APIs often limit the amount of data returned for a single request. Therefore, it's necessary to handle API pagination. If the API uses page numbers, you can loop through pages like this:
7. Deploying the script: Finally, deploy this script on a server. It'll work there constantly, check the API, and update data in MongoDB every 6 hours
requests
for ingesting data from the REST API, pymongo
to communicate with the MongoDB, and apscheduler
for scheduling your data refreshing job.
2. Request Data from API:
3. Connect to MongoDB:
4. Store Data into MongoDB:
Iterate through the JSON response, and insert each item into the database.
5. Set Up Scheduler: With
APScheduler
, you can set the function to run every 6 hours like this:
6. API Pagination: APIs often limit the amount of data returned for a single request. Therefore, it's necessary to handle API pagination. If the API uses page numbers, you can loop through pages like this:
7. Deploying the script: Finally, deploy this script on a server. It'll work there constantly, check the API, and update data in MongoDB every 6 hours
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View