API V1 bill search not yielding results found in browser search


CA AB 3109 can be found on OpenStates when searching simply for “AB 3109”.


When using the API, I get no results for either of the following queries:


The latter is more representative of what I’m doing in the browser, but I thought adding a state might help in case the issue was related to situations where the API will essentially return nothing when you don’t give a state because the result set is too large. That doesn’t seem to be a factor here, though. I don’t get a 400-type response in either case. I get a literal, empty JSON array back as the response in both examples.

Am I missing something in my expectations and/or execution?


Ah, right now the search in the API is using a keyword search, whereas the site had special handling for things that look like bill ids.

But, weird timing- the site just changed (as of tonight in fact)

The new site will gain a wide search soon based upon the API logic, but if you’re interested in the q= query adding functionality a feature request on https://github.com/openstates/openstates.org would be welcome


The application I work on provides a way to search OpenStates via the API. It has been simply passing user query text along as the q parameter to bills search. A user who was able to find many bills using this feature in the past was suddenly unable to find one recently which got me wondering about possible regressions or some such.

It looks like I will want to use the bill_id parameter if we have something like “AB 3109” to search on.


From an end user perspective, I think it’s counterintuitive that these bill ID strings aren’t considered when doing keyword search, but perhaps I’m just ignorant and/or lazy.


agree, I think these should be searched w/ the q param, mind filing a ticket?


Sorry for the late followup. Let me know if missed anything or can add anything helpful.


This topic was automatically closed 70 days after the last reply. New replies are no longer allowed.