Search Congress Bills since 1973


This tutorial shows you how to be build a simple Choreo that retrieves U.S. Congress bills and resolutions since 1973 (the 93rd Congress). It's a great example of how you can use Temboo to take a powerful, but relatively unknown API endpoint, and create a Choreo for it so that it's available to you in your choice of 7 programming languages.

Get Set Up

1Make sure you have a Temboo account. If you don't already have one, you can register for a free account here.

2Download and install Twyla for Mac or Windows. For information about how to obtain the Twyla installer, please contact support@temboo.com

Search Congress via GovTrack

We're going to use the GovTrack API to see what United States Congress has been up to for the past 40 years. Specifically, we're going to use their bill search endpoint. Let's get started.

1Drag a HTTP Request Step from the steps pallette to the canvas. Connect the Begin Step to your new HTTP Request Step.

Making a connection between the Begin step and the HTTP Request step

2Double click the HTTP Request Step to open the step property editor. On the Server tab, configure the URL field with the appropriate GovTrack endpoint. In this case, we're using the URL below:

 https://www.govtrack.us/api/v2/bill

Connecting the Server tab in the HTTP Request step

3GovTrack offers some really nice filtering features for searching. For many fields, operators are allowed in HTTP parameter names in the form of fieldname__operator. Allowed operators include: contains, exact, gt, gte, lt, lte, in, startswith, and range. Let's try using one of these for one of the searchable date fields within the Bill endpoint.

4Create two new Input variables, one called Query (a String) and another called IntroducedDate (an optional Date).

Creating the input variables for our GovTrack Choreo

5Back in the HTTP Request step, on the Request tab, specify the q and introduced_date__gt HTTP parameters using the inputs that you just created. Watch out for the double underscore (__) in that second parameter.

Configuring the Request tab in the HTTP Request step

6Next, create a new String output variable called Response. Make sure its type is set to 'File'.

Creating the Response output variable

7Back in the HTTP Request step, on the Response tab, specify the output variable in the Store Retrieved Data In field.

Configuring the Response tab of the HTTP Request to use the new output variable

8Finally, save your new Choreo, switch to the Test pane, and run your new GovTrack Choreo, providing your Query and IntroducedDate as inputs. When the Choreo has completed you can select the Response variable in the output log and you'll see the result of your GovTrack query.

Testing out the new GovTrack Choreo

Need Help?

We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.


Back