Hello, everyone.
So someone asked me, how can you build a API that is basically connected with our scraper?
And basically there's two ways that you can.
Approach this.
You can either have a scraper that is run at a timed interval.
So, for example, a scraper that is running every hour saves the data to a database.
And then you have a separate application, a API, which is serving the data from the database basically.
And then you can have a front end application or just a basic website which is displaying the APIs data.
The other way.
You can have, uh, you can do this approach.
Having a API to a scraper is to do a sort of in demand scraping.
So if the scraper is fast enough, maybe you could even just have a get request, just a get request
for the, the scraper and the scraper returns the result from the website.
If the scraper is a little slower, maybe you would do sort of a create or post request and you would
maybe get an ID back of the scraping request.
And then once the scraping has finished, you could use this ID to get the data once the scraping has
finished.
In both cases you could save the scraping result to a database.
You could either be a document driven, driven database such as MongoDB or it could be a SQL database.
So that's what we're going to look at in this section in particular.
It's going to be GraphQL for now and then it's going to be MongoDB or Mlab, which we're going to be
using.
So hang in there and we'll look at how you can save your scraping results to a mlab.
Database and how you can expose the data on GraphQL.