Jump to content

Monitoring API for changes


Boxerman

Recommended Posts

Hi all,

 

Just a quick one, i would like to monitor an API for changes, so the first run on the API would be to grab all 315 pages and enter them into my database, once added, i want to set up a cron job (i can do that) to monitor if anything gets added, im not sure whats the best way to go about that? Anyone have any ideas to point me in the right direction please? 

Link to comment
Share on other sites

Unless the API has some sort of the feature to make detecting changes easier than the only thing you can really do is download all 315 pages again and then compare them to what you downloaded the first time.

 

How you compare the data kind of depends on what the data is. You'll have to figure that part out. For example if it's json data you might just compare the serialized versions, or you might decode it an compare each field, or only specific fields. Whatever your use case calls for.

 

Beware of any API limits that are in place. You might get throttled/banned by the API provider if you hit the API to hard/fast. Might want to contact them and ask about what you want to do.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.