api.congress.gov icon indicating copy to clipboard operation
api.congress.gov copied to clipboard

Summaries endpoint is not working as expected

Open tomburge opened this issue 1 year ago • 1 comments
trafficstars

Here are 5 examples of using the base summaries endpoint and it is not working as expected with 3 of the 5 examples.

The base summaries endpoint along the congress and congress and bill type endpoints have the same behavior.

Example 1:

Endpoint with no filters: https://api.congress.gov/v3/summaries

Response: {'pagination': {'count': 0}, 'request': {'contentType': 'application/json', 'format': 'json'}, 'summaries': []}

Issue: No results are returned.

Example 2:

Parameters: {'limit': 5}

Endpoint with filter limit: https://api.congress.gov/v3/summaries

Response: {'pagination': {'count': 0}, 'request': {'contentType': 'application/json', 'format': 'json'}, 'summaries': []}

Issue: The limit filter is not being applied to the endpoint and no results are returned.

Example 3:

Parameters: {'limit': 5, 'offset': 1}

Endpoint with limit and offset: https://api.congress.gov/v3/summaries

Response: {'pagination': {'count': 0, 'prev': 'https://api.congress.gov/v3/summaries?offset=0&limit=5&format=json'}, 'request': {'contentType': 'application/json', 'format': 'json'}, 'summaries': []}

Issue: There is a prev but not next and no results are returned.

Example 4:

Parameters: {'fromDateTime': '2021-01-01T00:00:00Z'}

Endpoint with fromDateTime filter: https://api.congress.gov/v3/summaries

Response: {'pagination': {'count': 89768, 'next': 'https://api.congress.gov/v3/summaries?fromDateTime=2021-01-01T00:00:00Z&offset=20&limit=20&format=json'}, 'request': {'contentType': 'application/json', 'format': 'json'}, 'summaries': [..]}

Issue: No issue here as far as I can tell except that the argument fromDateTime is required but it does not say that in the API docs and is not consistent with other APIs that have been tested.

Example 5:

Parameters: {'fromDateTime': '2021-01-01T00:00:00Z', 'limit': 5, 'offset': 1}

Endpoint with fromDateTime, limit, and offset filters: https://api.congress.gov/v3/summaries

Response: {'pagination': {'count': 89768, 'next': 'https://api.congress.gov/v3/summaries?fromDateTime=2021-01-01T00:00:00Z&offset=6&limit=5&format=json', 'prev': 'https://api.congress.gov/v3/summaries?fromDateTime=2021-01-01T00:00:00Z&offset=0&limit=5&format=json'}, 'request': {'contentType': 'application/json', 'format': 'json'}, 'summaries': [...]}

Issue: No issue. Working as expected.

tomburge avatar Sep 29 '24 18:09 tomburge