Sentry api for fetching data

Is there some api that I could programmatically download infromation about events?
For example I need to send report about some correlation of event1 and event2 that both have the same tag.

Yes there is: https://docs.sentry.io/api/

Looks like you want this (I once wrote a little thing with it).

https://docs.sentry.io/api/events/get-project-events/

Scanning through all events will take a while, and some of them might be gone (sampled is the right term I think ?).
But you can still try your luck !

That is what i wanted. Thanks!

@bsergean I have tested API request List an Issue’s Events
But I received only 100 events.
Is it possible to download all saved events data for this issue?

Check this out to get the following events.
https://docs.sentry.io/api/pagination/

The python request library has support for “links”.

@bsergean Thank you!
that worked.
Sorry for being annoying, but there is one more problem.
It looks like there not all events saved.
If I look on web interface there around 1500 events per day(“LAST 30 DAYS” histogram).
But if I download all available events for this issue there are only ~1500 for 3 months.
As guy on backend said they are runing
"/www/sentry/bin/sentry --config=/etc/sentry.conf.py cleanup --days 90 > /dev/null"
Does this affect this behavior?
How to get all events for last 2 months for example

In my experience I was also missing some events when I was going through
the API. Probably the sentry folks would know better, this is the extent of
my knowledge …

I have found SENTRY_SAMPLE_DATA option for sentry server config
I think that the root cause