- THOMAS Home
- About THOMAS
- Bills, Resolutions
- Congressional Record
- Presidential Nominations
- Treaties
- Committee Reports
- Government Resources
- For Teachers
- Help
Related Resources at the Library
Direct Links to Thomas Documents
Web site developers may wish to add pre-programmed, encapsulated searches that link directly to one specific THOMAS document (e.g., the full text of an enrolled bill), or to a set of documents (e.g., all bills sponsored by a Member this Congress) -- without requiring users to come to the THOMAS Web site to execute the search.
Developers can use one of two major protocols to execute a search on a THOMAS database: GET and POST. Alternately, Legislative Handles, a new persistent URL service, may be used. With a simple syntax, Legislative Handles make it easy to type in legislative links to bibliographies, reference guides, emails, blogs, or web pages.
Below are some examples -- some using the GET protocol, some using the POST protocol -- of how a Web developer might build links into his/her Web page to THOMAS documents.
The following examples are for documents in the 104th Congress. Replace the "104" string with "109" or "103," when applicable.
Encapsulated Searches Using the "Get" Protocol
GET links are built by embedding a URL with a valid anchor link. The general syntax is:
<a href="valid URL here">Description of Link Here</a>
Note that your cursor turns into a small "hand" icon when running your mouse over a GET link (while it does not when using a POST link). Here are examples of direct links to THOMAS documents using the GET protocol to encapsulate the search.
- Making a link to the full text of a bill:
<a href="http://thomas.loc.gov/cgi-bin/query/z?c104:h.r.1234:">H.R. 1234</a>
Hotlink corresponding to above syntax: H.R. 1234 - Making a link to a certain version of a bill:
<a href="http://thomas.loc.gov/cgi-bin/query/z?c104:s.377.enr:">S. 377, Enrolled Version</a>
Hotlink corresponding to above syntax: S. 377, Enrolled Version - Making a link to the Bill Summary and Status record for a bill:
<a href="http://thomas.loc.gov/cgi-bin/bdquery/z?d104:h.r.1234:">H.R. 1234</a>
Hotlink corresponding to above syntax: H.R. 1234 - Making a link to a Congressional Record search:
<a href="http://thomas.loc.gov/cgi-bin/query/r?r104:@phrase(post+office):"> Congressional Record search for Post Office</a>
Hotlink corresponding to above syntax: Congressional Record search for Post Office
Note: For more information on the syntax for a word/phrase search in INQUERY, read The Complete Guide to Using THOMAS Under InQuery. When making an encapsulated search in a GET protocol link, substitute an @ sign for the # sign in an INQUERY search, and a + sign for a space. - Making a link to a Congressional Record document:
Congressional Record page in the first session (1995) of the 104th Congress:
<a href="http://thomas.loc.gov/cgi-bin/query/R?r104:FLD001:H01564:">House Page 1564</a>
Hotlink corresponding to above syntax: House Page 1564 in the first session
Since the Congressional Record starts numbering its "H," "S," "E," and "D" pages (House, Senate, Extensions of Remarks and Daily Digest) at "1" at the beginning of every session (NOT every Congress), the second session pages are differentiated from the first session pages of the same Congress in THOMAS by adding 50,000 to the page number. Thus, page H1564 is coded H01564 in the first session, and page H1564 is coded H51564 in the second session.
Congressional Record page in the second session (1996) of the 104th Congress:
<a href="http://thomas.loc.gov/cgi-bin/query/R?r104:FLD001:H51564:">House Page 1564</a>
Hotlink corresponding to above syntax: House Page 1564 in the second session
Note: Because of the way the data is configured by the Government Printing Office, only a link to the "document" level (text between Bodoni dashes), not the exact page, is possible. Only after the document is displayed can the page numbers within that document be built in a table of contents for that document. Use the "Find" command of your browser to locate the page number within the document, and click on it to see the text on that page. - Making a link to a House committee report:
<a href="http://thomas.loc.gov/cgi-bin/cpquery/z?cp104:hr189.104:">House Committee Report 104-89</a>
Hotlink corresponding to above syntax: House Committee Report 104-89 - Making a link to a Senate committee report:
<a href="http://thomas.loc.gov/cgi-bin/cpquery/z?cp104:sr51.104:">Senate Committee Report 104-51</a>
Hotlink corresponding to above syntax: Senate Commitee Report 104-51 - Making a link to a Presidential nomination:
<a href="http://thomas.loc.gov/cgi-bin/ntquery/z?nomis:110PN0017800:">PN178-110</a>
Change the Congress number embedded in the URL (remember this is for the 100th through the current Congress). Replace the number with the number you need, using 0-fills so the number is 5 characters long. Add 00 (or an appropriate part number) after the number. Finally, change the text displayed in the link. Hotlink corresponding to above syntax: PN178-110
Encapsulated Searches Using The "Post" Protocol
In addition to the hypertext link using the GET protocol to do an encapsulated searches Web developers may want to use a pre-programmed POST search. This syntax is a little more involved but allows you to build a "button" (using an HTML form), which executes the encapsulated search.
1. Making a link to all bills sponsored by a certain member:
<form action ="http://thomas.loc.gov/cgi-bin/bdquery" METHOD=POST>
<input name="Dbd104" type=hidden value="d104">
<input name="srch" type=hidden value="/bss/d104query.html">
<input name="TYPE1" type=hidden value="bimp">
<input name="HMEMB" type=hidden value="MORELLA">
<input name="Sponfld" type=hidden value="SPON">
<input type="submit" value="Bills Sponsored by Rep.
Morella (104th Congress)">
</form>
All the values above are "boilerplate" for the Bill Summary
& Status files, except:
* "105" may be substituted for "104" to get bills
sponsored in the 105th Congress
* "SMEMB" may be substituted for "HMEMB" for searching
against a list of Senate members
* "MORELLA" may be substituted with the member of your choice
* "COSP" may be substituted for "SPON" to get bills
cosponsored by the member of your choice; "SPCO" may be substituted
for "SPON" to get bills sponsored and cosponsored by the member.
* "value" in the last line of the form will be your description
of the link that will appear on the button
Button that corresponds to above syntax:
2. Making a link to all House Agriculture Committee Reports in the 104th
Congress:
<form action ="http://thomas.loc.gov/cgi-bin/cpquery" METHOD=POST>
<input type="hidden" name="querycp104" value="">
<input type="hidden" name="Section" value="All">
<input type="hidden" name="crnSection" value="None">
<input type="hidden" name="HCOMM" value="AGRICULTURE">
<input type="hidden" name="MaxDocs" value="100">
<input type="submit" value="House Agriculture Committee
Reports (104th)">
</form>
All the values above are "boilerplate" for the Committee Reports
files, except:
* "105" may be substituted for "104" to get bills
sponsored in the 105th Congress
* "SCOMM" may be substituted for "HCOMM" for searching
against a list of Senate Committees
* "AGRICULTURE" may be substituted with the committee name of
your choice
* "value" in the "MaxDoc" line specifies the maximum
number of reports meeting your search criteria to be returned
* "value" in the last line of the form will be your description
of the link which will appear on the button
Button that corresponds to the above syntax:
3. Making links to reports on partial birth abortions in the Committee
Reports files with word/phrase text search:
<form action="http://thomas.loc.gov/cgi-bin/cpquery" method="post" >
<input type="hidden" name="querycp104" value="partial
birth abortions">
<input type="hidden" name="Section" value="All">
<input type="hidden" name="crnSection" value="None">
<input type="hidden" name="MaxDocs" value="10">
<input type="submit" value="Committee Reports on Partial
Birth Abortions - 104th">
</form>
Button corresponding to the above syntax: