Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrgBook BC API returns a 400 Error #765

Closed
amanji opened this issue Feb 2, 2024 · 3 comments
Closed

OrgBook BC API returns a 400 Error #765

amanji opened this issue Feb 2, 2024 · 3 comments

Comments

@amanji
Copy link
Contributor

amanji commented Feb 2, 2024

It was reported that the (v3/v4)/search/topic endpoint returns a 400 Error when paging past a certain number of results.

For example: https://orgbook.gov.bc.ca/api/v4/search/topic?ordering=-score&q=abc&inactive=false&latest=true&revoked=false

Returns 541 results

The first 10 pages of results can be accessed:

https://orgbook.gov.bc.ca/api/v4/search/topic?inactive=false&latest=true&ordering=-score&page=10&q=abc&revoked=false

The result of the 10th page shows a URL to the next page available:

Image

Accessing the 11th page onwards returns a 400 Error. This is consistent regardless of the query used.

Image

@amanji amanji converted this from a draft issue Feb 2, 2024
@swcurran
Copy link
Contributor

swcurran commented Feb 2, 2024

That’s a “feature” that @WadeBarnes added to stop bots from scraping the database.

Who reported the issue?

@WadeBarnes
Copy link
Member

@swcurran, Correct

@esune
Copy link
Member

esune commented Feb 6, 2024

Closing as this is a known behaviour.

For context, the limit to query paging was introduced to avoid issues deriving from performing queries that fetch large data sets (unbounded) that would cause out-of-memory issues in the search engine.

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants