0

I am currently checking this file: https://api.steampowered.com/IEconService/GetTradeOffers/v1/?key=700D84417970EEAE593ACB8BE455B16E&format=json&get_sent_offers=1 for a change every 5 seconds but Is there any sort of way that I can get notified E.g. a post request when this website changes? I had a look at google push notifications but It seems that it only works for their own api's not external api's

mre12345
  • 1,087
  • 4
  • 16
  • 23
  • 1
    no, that would be something the site itself has to offer/perform. you can fetch just the HEAD and examine the Last-Modified, ETag, or Content-Length headers to spot changes without refetching the data – dandavis Jan 08 '16 at 21:41
  • Ok thanks! I'll ask the api providers if they offer such a service. So if they say no, is there no way at all that this could cause I really don't want to be polling every 5 seconds. – mre12345 Jan 08 '16 at 21:48

1 Answers1

1

I don't know what do you mean by getting notified.

If you want to get an email when the page changes you can use something like this Google Chrome extension

If you mean it in an programmatically way, then you will have to GET the JSON object from the URL every 5 sec and compare it to the previous version, see this question regarding the compare part.

Community
  • 1
  • 1
Ionut
  • 1,729
  • 4
  • 23
  • 50
  • By getting notified, I want the service to send a POST request to a url that I specify. E.g. if I was tracking this JSON file: someoneswebsite.com/api/randomjson for a change then when it changes, it would automatically send a POST request to my website E.g. mywebsite.com/APIprotected/newnotification EDIT: Is google push notifications what I am looking for? – mre12345 Jan 08 '16 at 22:05
  • @mre12345 What you're describing is typically called a `webhook`. If you they provide something like that it will probably be called that. – Paul Jan 08 '16 at 22:13
  • ok thanks!, I'll check if the providers of the api provide a webhook – mre12345 Jan 08 '16 at 22:17