2

I've looked at GET /events but it returns all events not just push events which I'm interested in.

I've read about webhooks and this pushEvent in particular but that can be configured to only a repository to get notified if pushed to that one repo.

But I want to get post requests like webhooks for all push requests across all public repos from all users. Something like Github Archive.

SnShines
  • 95
  • 9
  • What's wrong with `GET /events` and ignoring anything you don't care about? – ChrisGPT was on strike Jan 30 '18 at 18:07
  • That's what I'm doing currently but based on `id` I'm assuming I'm missing a lot of events as it returns only 30 events (?) and have an API limit of 5000 calls per hour. Not to mention their abuse detection mechanism. Wondering if there is a webhook for all push events on all of Github. – SnShines Jan 31 '18 at 02:35
  • No, there's no webhook for that. Webhooks are per-repository and configured by repository owners. There are lots of reasons that `id`s could have gaps, one of the most obvious being that you're only getting _public_ events and GitHub has lots of clients who pay for private repos. – ChrisGPT was on strike Jan 31 '18 at 02:51
  • Thanks. Running `GET /events` from two different accounts and merging the final results seems a bit better. Might need more accounts. I guess I'm violating Github T&C. – SnShines Jan 31 '18 at 10:20
  • The problem with using `GET /events` is that the results are limited to 300 events per repo. To make it worse, only events created within the past 90 days is included in the timelines. – Poonacha Jan 31 '18 at 18:25
  • 1
    @SnShines FYI gtihub archive is using `GET /events` too & you can find the source code [here](https://github.com/igrigorik/githubarchive.org) including crawler & bigquery – Bertrand Martel Feb 01 '18 at 02:30

1 Answers1

2

While the API GET /events remains the main solution (possibly from different users as commented), there is an important change from August 2018:

Public events API delayed by five minutes

The public events API is now delayed by five minutes.
As a result, when you query the API, the most recent event returned will have occurred at least five minutes ago.

The API is otherwise unchanged and continues to support pagination and fetching of up to 300 events. No other events APIs are affected and they will continue to deliver events in real time.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250