# GSA eLibrary Contract ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/gsaelibrary/contract` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 1 credit per call | | **Documentation** | https://www.piloterr.com/library/gsaelibrary-contract | ## Description Read one GSA eLibrary contractor record from the contract URL returned by search. ## Authentication - **Key Name:** `x-api-key` - **Location:** HTTP Header - **Get an API key:** https://app.piloterr.com/register ## Example Request ```bash curl --location --request GET 'https://api.piloterr.com/v2/gsaelibrary/contract' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### US RADAR INC ```json { "url": "https://www.gsaelibrary.gsa.gov/ElibMain/contractorInfo.do?contractNumber=GS-07F-0239T&contractorName=US+RADAR+INC&executeQuery=YES", "epls": "Contractor not found on the Excluded Parties List System", "email": "ron@usradar.com", "phone": "732-566-2035", "address": "173 AMBOY RD, MORGANVILLE, NJ 07751-1003", "sam_uei": "TL26M1812HG4", "website": "http://usradar.com", "terms_url": null, "categories": [ { "sin": "334515", "name": "Diagnostic, Measuring and Testing Equipment" } ], "schedule_name": "Multiple Award Schedule", "socio_economic": "Small Business", "contract_number": "GS-07F-0239T", "contractor_name": "US RADAR INC", "schedule_number": "MAS", "government_poc_name": "Brian Buffett", "government_poc_email": "brian.buffett@gsa.gov", "government_poc_phone": "470-496-9410", "current_option_period_end_date": "Feb 14, 2027" } ``` ## Documentation ## Overview Read one contractor page on GSA eLibrary. The response is a flat record: identity, address, SAM UEI, schedule, government point of contact, and the SIN categories on the contract. Pass the `url` from a search row whose `result_type` is `contract`. For US RADAR INC that URL is the `contractorInfo.do` link with `contractNumber=GS-07F-0239T` and `contractorName=US+RADAR+INC`. The same call with only `GS-07F-0239T` returns 404. ## Quickstart GET and POST take the same `query`. This example uses GET. URL-encode the query value. ``` GET https://api.piloterr.com/v2/gsaelibrary/contract?query=https://www.gsaelibrary.gsa.gov/ElibMain/contractorInfo.do?contractNumber=GS-07F-0239T&contractorName=US+RADAR+INC&executeQuery=YES ``` The record comes back with `contract_number` `GS-07F-0239T` and `contractor_name` `US RADAR INC`. ## Parameters | Parameter | Required | Example | |---|---|---| | `query` | yes | contractor URL from search | `query` is required. Use the absolute `contractorInfo.do` URL from search. A host other than `gsaelibrary.gsa.gov`, or a URL that is not `contractorInfo.do`, returns 400. A contract number such as `GS-07F-0239T` is accepted as input and returns 404 when GSA cannot resolve it without the contractor name. ## Response fields | Field | Type | Meaning | |---|---|---| | `contract_number` | string or null | Contract number, such as `GS-07F-0239T` | | `contractor_name` | string or null | Legal name on the page | | `address` | string or null | Street, suite, and city joined with commas | | `phone` | string or null | Phone | | `email` | string or null | Email | | `website` | string or null | Web address | | `sam_uei` | string or null | SAM UEI | | `socio_economic` | string or null | Socio-economic indicators, joined when several are printed | | `current_option_period_end_date` | string or null | Option end date as printed, such as `Feb 14, 2027` | | `government_poc_name` | string or null | Government point of contact | | `government_poc_phone` | string or null | POC phone | | `government_poc_email` | string or null | POC email | | `epls` | string or null | Excluded-parties text | | `schedule_number` | string or null | Schedule code, such as `MAS` | | `schedule_name` | string or null | Schedule title | | `categories` | array | SIN categories on the contract. Each item has `sin` and `name` | | `terms_url` | string or null | Terms document URL when the page exposes one | | `url` | string | Contract URL that was requested | There is no `results` wrapper and no pagination. `categories` can contain one SIN, for example `334515` / `Diagnostic, Measuring and Testing Equipment` on the US RADAR INC contract. ## Use cases - Confirm the SAM UEI, address, and socio-economic line for US RADAR INC before a set-aside check. - List the SIN categories attached to `GS-07F-0239T` for a market-research memo. - Copy the government POC name, phone, and email, plus the current option period end date, into a vendor file. ## Error codes | Code | Meaning | |---|---| | `400` | Empty query, a malformed contract number, or a URL outside gsaelibrary.gsa.gov | | `401` | Missing API key | | `404` | eLibrary could not find that contract. A number without the contractor name often lands here | | `500` | The fetch failed | ## Related endpoints [GSA eLibrary Search](https://www.piloterr.com/library/gsaelibrary-search)