Need advice on developing the type of API for the site quests.

I have a quest aggregator (PHP, Wordpress) with questroom sessions on it. Now, with the help of Curl, I get the following data from all the sites of the quest rooms: quest, date, time, whether it is free.

I want to make an API, since there are a lot of problems with parsing.

While there is such an option, steelen from one of the major aggregators:

  1. The client generates a json-file with the schedule, from where I get the data using a GET request. This file is automatically generated every day and changes when booking a session (instead of changing the file, I would add a post-request with the booking data to my site).

  2. The client generates a URL to which I will send booking data already from my aggregator by post request. Thus, it will also be possible to book a session on my website, and the owners of the questroom will receive this reservation.

I hope, clearly described. Is this a normal algorithm? Maybe something is wrong, or can something be improved or done differently? I would be grateful for the advice.

  • that is, you want to outweigh your problems on customers? they will not be happy, and they will hardly solve this problem. and the second - once a day, the formation is rare. Updates should be permanent upon the order, otherwise what's the point? - teran
  • Customers are just interested in this. In general, this is a normal practice for questrooms. most will be able to integrate. About the formation once a day - I agree, that's why I added: "(instead of changing the file, I would add a post-request with the booking data to my site)" - www
  • As far as I understand, that aggregator, whose documentation I took, sends a get request once every 10 minutes - www

1 answer 1

In theory, everything is wonderfully painted, only this is of little practical use. 99% of quest site owners will not bother with it. Especially if they need to issue a daily schedule in JSON and receive booking data via POST requests (most of the online stores do not even have a normal YML file for Yandex.Market, what to speak about quests).

Use better direct parsing from the sites of quests. And when booking you send a notification to the email quest owner. This is the most reliable way that will allow you to reach the maximum business audience.

I want to make an API, since there are a lot of problems with parsing.

It is easier to make one normal parser than to transfer a significant percentage of quests owners to the API. If you want to take the prepared data - recommend to the quest owners to keep a simple text file (like robots.txt) on your site, where the schedule will be in a simple form. It can be updated both manually and through scripts. This is much simpler than the same JSON and in its minimal form does not even require programming skills. Sending booking data is better done by email. All the same, this channel is the main for most quest owners.

  • Now I do. But a couple of months ago, half of the sites automatically blocked my script. The owners claim that they did not. Currently, these sites use a static schedule where the booked sessions are not shown. - www
  • Wrote about this problem here: stackoverflow.com/questions/46234931/curl-cant-get-html - www
  • @www see the paragraph about the text file in my answer (just added). - Dmitry Maslennikov
  • Yeah, I saw. Thank! - www
  • @www added a little more response. Try experimenting to start with this file. if people get involved, you can always switch it to a full-fledged API. - Dmitry Maslennikov