Field data types

Prev Next

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]

type

Primitive data type

group

Group name for the kind of data the value represents

class

Group classification for the kind of data the value represents

format

Additional 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

Value

Description

Example

float.currency.value

Currency value as a float

499.01

int.currency.value

Currency value as an integer

499

string.currency.code

Currency code

"EUR"

Duration

Value

Description

Example

int.duration.seconds

Length in seconds

127

Geographical

Value

Description

Example

string.geo.city

City name

"London"

string.geo.continent

Continent name

"Asia"

string.geo.coordinates

Latitude and longitude combined

"51.5074, -0.1278"

string.geo.country

Country name

"Finland"

string.geo.country.twolettercode

Country code as alpha-2 from ISO 3166-1

"FI"

string.geo.latitude

Latitude coordinate

"51.5074"

string.geo.longitude

Longitude coordinate

"-0.1278"

string.geo.metro

Metropolitan area

"Helsinki"

string.geo.region

Region name

"Virgin Islands, U.S."

string.geo.street

Street address

"Downing Street"

string.geo.zip

ZIP code or postal code

"10121"

Language

Value

Description

Example

string.language.locale

Language locale from RFC 1766

"pt_BR"

string.language.twolettercode

Language code as alpha-2 from ISO639-1

"SV"

string.language.value

Generic language

"English (United States)"

Number

Value

Description

Example

float.number.percentage

Percentage value between 0 and 100 as a float

80.5

float.number.ratio

Ratio value between 0 and 1 as a float

0.02

float.number.value

Generic number value as a float

0.3

int.number.percentage

Percentage value between 0 and 100 as an integer

51

int.number.value

Generic number value as an integer

57

Person

Value

Description

Example

string.person.age

Age

"10 - 15"

string.person.gender

Gender

"female"

Primitive

Value

Description

Example

bool

Simple boolean

true

Text

Value

Description

Example

string.text.email

Email address

"...@supermetrics.com"

string.text.json

JSON encoded data

"["value A", "value B"]"

string.text.percentage

Percentage value between 0 and 100

"100%"

string.text.phone

Phone number

"+358..."

string.text.url

URL address

"https://supermetrics.com/..."

string.text.value

Generic text value

"Value"

Time

Value

Description

Example

string.time.date

Date formatted as YYYY-MM-DD

"2017-02-03"

string.time.datetime

Date and time formatted as YYYY-MM-DD HH:MM:SS

"2017-08-12 12:33:01"

string.time.dayofmonth

Day of month

"8"

string.time.dayofweek

Weekday number and name combined. Numbered from 0 Sunday to 6 Saturday.

"0 Sunday"

string.time.dayofweekiso

Weekday number and name combined. Numbered from 1 Monday to 7 Sunday from ISO 8601.

"7 Sunday"

string.time.gmtoffset

GMT offset

"GMT+0300"

string.time.hm

Time for hours and minutes

"03:57"

string.time.hms

Time for hours, minutes and seconds

"03:57:25"

string.time.hour

Hour without leading zeroes

"5"

string.time.minute

Minutes without leading zeroes

"7"

string.time.month

Month name

"April"

string.time.quarter

Year quarter

"3"

string.time.timezone

Timezone name from timezone database names

"Europe/Helsinki"

string.time.week

Week number

"07"

string.time.weekiso

Week number using ISO 8601

"04"

string.time.year

Year formatted as YYYY

"2017"

string.time.yearmonth

Year and month number combined

"2017 | 12"

string.time.yearweek

Week year and number combined

"2017 | 05"

string.time.yearweekiso

Week year and number combined using ISO 8601

"2017 | 06"