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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.