API: Support querying multiple observations by ID at once
Some users need to fetch a large number of observations, e.g. as training data for their ML learning or for SSA. Currently this will result in >1000 subsequent queries, fetching one observation at-a-time. This is slow and seems optimizable.
Add a new parameter id__in
to the API endpoint /observations
. Example usage:
https://network-dev.satnogs.org/api/observations/?id__in=32224,32241
The following patch to the ObservationViewFilter
in network/api/filters.py might achieve that:
+ id__in = django_filters.NumberFilter(field_name='id', lookup_expr='in')
The abuse potential of the proposed solution should be evaluated. I.e. paging should still apply, naturally limiting the number of observations per request. But the cost to scrape might still be reduced. Potentially this might need a re-evaluation of the rate limiting parameters.