Field data types

Data types are Supermetrics classifications for the type of data the field should return, what it represents, and what format it is in.

Syntax

type.[group].[class].[format]
typePrimitive data type
groupGroup name for the kind of data the value represents
classGroup classification for the kind of data the value represents
formatAdditional format information, when available

Considerations

Please note that classifications are provided only as additional information based on what the source API is expected to deliver. We do not perform type casting or other normalizations to the data by default. Therefore, classifications and returned data can be subject to inconsistencies.

Data types

Currency
ValueDescriptionExample
float.currency.valueCurrency value as a float 499.01
int.currency.valueCurrency value as an integer 499
string.currency.codeCurrency code "EUR"

Duration
ValueDescriptionExample
int.duration.secondsLength in seconds 127

Geographical
ValueDescriptionExample
string.geo.cityCity name "London"
string.geo.continentContinent name "Asia"
string.geo.coordinatesLatitude and longitude combined "51.5074, -0.1278"
string.geo.countryCountry name "Finland"
string.geo.country.twolettercodeCountry code as alpha-2 from ISO 3166-1 "FI"
string.geo.latitudeLatitude coordinate "51.5074
string.geo.longitudeLongitude coordinate "-0.1278
string.geo.metroMetropolitan area "Helsinki"
string.geo.regionRegion name "Virgin Islands, U.S."
string.geo.streetStreet address "Downing Street"
string.geo.zipZIP code or postal code "10121"

Language
ValueDescriptionExample
string.language.localeLanguage locale from RFC 1766 "pt_BR"
string.language.twolettercodeLanguage code as alpha-2 from ISO639-1 "SV"
string.language.valueGeneric language "English (United States)"

Number
ValueDescriptionExample
float.number.percentagePercentage value between 0 and 100 as a float 80.5
float.number.ratioRatio value between 0 and 1 as a float 0.02
float.number.valueGeneric number value as a float 0.3
int.number.percentagePercentage value between 0 and 100 as an integer 51
int.number.valueGeneric number value as an integer 57

Person
ValueDescriptionExample
string.person.ageAge "10 - 15"
string.person.genderGender "female"

Primitive
ValueDescriptionExample
boolSimple boolean true

Text
ValueDescriptionExample
string.text.emailEmail address "...@supermetrics.com"
string.text.jsonJSON encoded data "["value A", "value B"]"
string.text.percentagePercentage value between 0 and 100 "100%"
string.text.phonePhone number "+358..."
string.text.urlURL address "https://supermetrics.com/..."
string.text.valueGeneric text value "Value"

Time
ValueDescriptionExample
string.time.dateDate formatted as YYYY-MM-DD "2017-02-03"
string.time.datetimeDate and time formatted as YYYY-MM-DD HH:MM:SS "2017-08-12 12:33:01"
string.time.dayofmonthDay of month "8"
string.time.dayofweekWeekday number and name combined. Numbered from 0 Sunday to 6 Saturday. "0 Sunday"
string.time.dayofweekisoWeekday number and name combined. Numbered from 1 Monday to 7 Sunday from ISO 8601. "7 Sunday"
string.time.gmtoffsetGMT offset "GMT+0300"
string.time.hmTime for hours and minutes "03:57"
string.time.hmsTime for hours, minutes and seconds "03:57:25"
string.time.hourHour without leading zeroes "5"
string.time.minuteMinutes without leading zeroes "7"
string.time.monthMonth name "April"
string.time.quarterYear quarter "3"
string.time.timezoneTimezone name from timezone database names "Europe/Helsinki"
string.time.weekWeek number "07"
string.time.weekisoWeek number using ISO 8601 "04"
string.time.yearYear formatted as YYYY "2017"
string.time.yearmonthYear and month number combined "2017 | 12"
string.time.yearweekWeek year and number combined "2017 | 05"
string.time.yearweekisoWeek year and number combined using ISO 8601 "2017 | 06"
Last updated 2021-04-22 UTC.