usgpo / api

services to access govinfo content and metadata
https://api.govinfo.gov
Other
183 stars 58 forks source link

Retrieve CREC documents which have the property "Congress Member Speaking" #139

Closed hslsaunders closed 1 year ago

hslsaunders commented 1 year ago

Hi, is it currently possible to retrieve documents which have the Metadata Field "Congress Member Speaking?" Which member is speaking isn't important to my search, I just want to find documents that have that property on them. I have been attempting to use the query parameter in the search endpoint, but haven't been able to make it return any documents which hold that property. Thanks!

jonquandt commented 1 year ago

A search request with something like collection:crec member:mccain should return results that have that.

https://www.govinfo.gov/help/crec#searching

You can also specify the role specifically, like so:

{
  "query": "collection:crec mods:congMember:@role:speaking and member:mccain",
  "pageSize": 10,
  "offsetMark": "*",
  "sorts": [
    {
      "field": "score",
      "sortOrder": "DESC"
    }
  ]}

For searching across MODS attributes, you need to do mods:field:@attribute:attribute value

The first result for this including the member information in the granule summary and MODS

Example of a member reference in the granule summary:

members:[{
      "gpoId": "8253",
      "authorityId": "754",
      "role": "SPEAKING",
      "chamber": "S",
      "congress": "107",
      "bioGuideId": "M000303",
      "memberName": "McCain, John",
      "state": "AZ",
      "party": "R"
    }]

Please let me know if there is anything I can clarify.