What is the best approach for storing data from API requests in my own mysql data base? I want to limit the number of requests but store all the data for all the permutations availbe so that when the visitor is on the hotel detail page, I won’t have to send request to the API for price details.
It’s for a tourism website with 8 different API and hundreds of hotels.
I got the regions and hotels but now I’m faceing the issue of storeing room prices for each hotel.
The APIs don’t have default data and return prices only if you send a few parameters to them.
How would you even approach this problem?
My first idea is to have one cronjob that gets prices for all the rooms, for every permutation, from each API and write the data into a local csv file.
Then another cron job that reads that csv and updates my tables.
However, the number of permutations is just so large including start date – end date, number of persons, number of children or no children.
Thank you!
webDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1