Skip to main content

Job Metadata API

You can also call these optional APIs to view the metadata of a job before or after running:

Data Snippet

The Data Snippet API returns the header columns and first 10 rows of the data at different stages of the configuration process. Note that all values are converted to strings.

The dataNode argument can take the following values:

  • raw: the data immediately after ingestion.
  • pivoted: the data after pivot methods have been applied.
  • preClean: the data prior to cleaning methods (imputation, row dropping, text processing) have been applied.
  • final: the final data node created by running the job.

If unspecified, the default dataNode is preClean. Note also that dataResourceName is an optional argument when using the JavaScript client library.

const dataSnippetResponse = segna.getDataSnippet(jobId, dataResourceName, dataNode);

Example Response:

{
"dataTable": [
["Name", "Age", "Hates Data Wrangling?"],
["John", "21", "True"],
["Mary", "34", "True"],
["Trudy", "24", "True"],
...
]
}


Unique Ratios

The Unique Ratios API returns the ratio of unique values for each column. The higher the ratio, the more unique the values are.

const uniqueRatiosResponse = segna.getUniqueRatios(jobId);

Example Response:

{
"uniqueRatio": {
"datasource 1": {
"column 1": 0.5,
"column 2": 1,
"column 3": 0.02
}
}
}


Missing Ratios

The Missing Ratios API returns the ratio of missing values for each column.

missingRatio=numberOfMissingValueslengthOfData\text{missingRatio} = \frac{\text{numberOfMissingValues}}{\text{lengthOfData}}

Ratio ranges from 0 to 1, where 0 is no missing values and 1 is all missing values.

curl -X GET https://backend.segna.io/public/client-side/v1/metadata/{jobId}/missing_ratios \
-H 'x-api-key: YOUR_API_KEY'

Example Response:

{
"missingRatio": {
"datasource 1": {
"column 1": 0.5,
"column 2": 1,
"column 3": 0.02
}
}
}