Developer API Documentation

FLC Business data is available through a REST API following the JSON:API specification for the formatting of returned data.

The API allows access to several different resource types under separate endpoints. For example, the "Regions" endpoint at https://www.federallabs.org/api/v1.0/regions returns a listing of the different geographical regions used to categorize the Federal Labs. Each Region has an ID, and can be looked up individually via that ID (example for the "Mid-Continent" Region: https://www.federallabs.org/api/v1.0/regions/132).

Resources and relationships

  • Laboratories: The Federal Laboratories and their Facilities. Related to Agencies, Regions, Available Technologies, Technology Areas, and Technology Disciplines.
  • Agencies: Federal Agencies that are the parent organizations of Laboratories. Related to Laboratories.
  • Available Technologies: Technologies that Laboratories are making available for licensing. Related to Laboratories.
  • Technology Areas: Categories of technology work that a Laboratory specializes in. Related to Laboratories.
  • Technology Disciplines: Categories of technology work that a Laboratory specializes in. Related to Laboratories.
  • Regions: Geographical Areas where Laboratories are located. Related to Laboratories.

Filtering resources

It is possible to have the server filter the response from any endpoint, according to fields or relationships. This is accomplished by adding the "filter[field]" url parameter. For example, a common need is to return the list of Available Technologies related to a particular Laboratory. To do this, you would filter Available Technologies on the "laboratory" field (first looking up the laboratory ID in the Laboratories endpoint if needed): https://www.federallabs.org/api/v1.0/available_technologies?filter[labor....

It is possible to filter on multiple fields by supplying multiple filter parameters with different fields. This query returns the Laboratories that are in the "Mid-Continent" region, and have the ownership_code indicating that they are Governement Owned and Government Operated: https://www.federallabs.org/api/v1.0/laboratories?filter[region]=132&fil....

The default filter operator is exact equality, but it is also possilble to use other operators such as "CONTAINS" for text fields or "IN" for numeric fields. This is done by supplying the value and operator for the filter in separate parameters. This query returns all labs that contain the string 'USDA' in the name: https://www.federallabs.org/api/v1.0/laboratories?filter[name][value]=US.... This query returns technologies from labs whose IDs are in the set of values (144013, 144017): https://www.federallabs.org/api/v1.0/available_technologies?filter[labor....

Sorting query results

You can use the 'sort' url parameter to sort the list of entities by multiple properties. List every property in a comma-separated string, in the order that you want to sort by. Prefixing the property name with a dash (-) will sort by that property in a descending order; the default is ascending. For example, to sort the Available Technologies by Title (ascending) and then Internal Reference Number (descending): https://www.federallabs.org/api/v1.0/available_technologies?sort=title,-....

Limiting the number of query results

You can use the 'range' url parameter to limit the number of results returned from a query (up to the maximum of 50 results in a single response, which is the default without the 'range' parameter). This query returns the first 5 Available Technologies: https://www.federallabs.org/api/v1.0/available_technologies?range=5.

You can use the 'offset' url parameter to select the starting point of the returned results. This query returns Available Technologies, starting with the 5th result: https://www.federallabs.org/api/v1.0/available_technologies?offset=5.

You can paginate the query results using the 'page' url parameter. This query returns the 2nd page of Available Technologies (from 50 to 100): https://www.federallabs.org/api/v1.0/available_technologies?page=2.

Limiting the returned fields from a query

Using the "fields" query string, you can declare which fields should be returned. This can be useful when only particular fields of a resource are needed. This query returns only the agencies associated with each lab: https://www.federallabs.org/api/v1.0/laboratories?fields=agency. You can supply multiple fields by separating them with commas. This query returns agency and region data for laboratories: https://www.federallabs.org/api/v1.0/laboratories?fields=agency,region