Skip navigation

Reference Manual

Data rows

https://services.onetcenter.org/ws/database/rows/[table ID]
JSON XML
{
   "info" : "https://services.onetcenter.org/ws/database/info/knowledge",
   "start" : 1,
   "end" : 20,
   "total" : 57618,
   "link" : [
      {
         "href" : "https://services.onetcenter.org/ws/database/rows/knowledge?start=21&end=40",
         "rel" : "next"
      }
   ],
   "table_id" : "knowledge",
   "row" : [
      {
         "onetsoc_code" : "11-1011.00",
         "title" : "Chief Executives",
         "element_id" : "2.C.1.a",
         "element_name" : "Administration and Management",
         "scale_id" : "IM",
         "scale_name" : "Importance",
         "data_value" : 4.78,
         "n" : 28,
         "standard_error" : 0.1102,
         "lower_ci_bound" : 4.5564,
         "upper_ci_bound" : 5,
         "recommend_suppress" : "N",
         "not_relevant" : null,
         "date_updated" : "2023-08-01",
         "domain_source" : "Incumbent"
      },
      ...
   ]
}

This response provides data from the given table. The required table ID can be retrieved from the List of data tables service. Data is returned in the row elements, with each column labeled by its ID from the Table column information service.

Filtering

To retrieve only rows matching particular criteria, one or more filter parameters may be used. The returned records must match every filter (Boolean AND). A filter parameter has the pattern:

filter=[column ID].[operator].[target value]

The operators available for a column depend on the type field of that column, as reported by the Table column information service:

Text columns

  • eq - Column must fully match the target text. All text filters are case insensitive.
  • contains - Column must include the target text.
  • startswith - Column must begin with the target text.
  • endswith - Column must end with the target text.

Number columns

  • eq - Column must be numerically equivalent to the target value.
  • lt - Column must be less than the target value.
  • lte - Column must be less than or equal to the target value.
  • gt - Column must be greater than the target value.
  • gte - Column must be greater than or equal to the target value.

Date columns

  • eq - Column must match the target date. All date filters require dates in the form YYYY-MM-DD.
  • before - Column must be earlier than the target date.
  • onbefore - Column must be earlier than or equal to the target date.
  • after - Column must be later than the target date.
  • onafter - Column must be later than or equal to the target date.

In addition, optional columns of any type have an additional operator:

  • na - Matches rows where data is not available for this column. Does not take a target value.

Any filter operator can be negated by prepending n to the name. For example, the operator neq means the column data must not match the target value.

Sorting

By default, rows are returned in the order they appear within the downloadable Database files. To change this, add one or more sort parameters with the desired column ID. To reverse the sort, append .descending to the column ID.

Pagination

The result list is paged, returning 20 rows at a time by default. To navigate the full set of results, use the link rel="next" and link rel="prev" elements, or provide start and end parameters to jump directly to the desired results.

Optional data

For columns reported as optional in the Table column information service, data may not be available. In these cases, the column will be present in the results, but the value will be null (JSON output) or an empty string (XML output), regardless of data type. As described above, the na and nna filter operators may be used to find or omit cases where optional data is unavailable.

In this section