Nicholas Nguyen
Nicholas Nguyen

Reputation: 11

How do I add API data into my MongoDB with Spark/Python?

I am working on a project with this API https://www.balldontlie.io/api/v1/players and have been trying to add it into a database within MongoDB.

Is there a way to add it into MongoDB using Spark?

I was able to pull it up with Spark/Python as shown in the picture but now struggling to find a way to add it into a collection in a database within MongoDB. I have added json or csv files into Mongo before, but never straight from an API link. Here is what I have so far by adding getting the API link with Spark/Python. enter image description here

Upvotes: 1

Views: 56

Answers (0)

Related Questions