Crosstab
Your entitlements change which surveys and authorization groups you can call.
A valid API key without access to the requested dataset returns 403 — see
Authentication.
Getting started
https://engines.api.telmar.com/omg/prd/v1/crosstab
Executes a crosstab query against a specified survey dataset. Returns weighted audience counts, unweighted respondent counts, and stability indicators for each requested target code.
Every request needs a Telmar-Engine-Authorizer API key.
Main parameters
Survey and authorization group
SurveyCode identifies the target survey dataset (e.g. "M20F").
AuthorizationGroup is an optional authorization group filter — use "_ALL_"
to include all groups.
{
"SurveyCode": "M20F",
"AuthorizationGroup": "_ALL_"
}
Population base
PopulationBaseCode identifies the population base for the query (e.g.
"AR18_24").
{
"PopulationBaseCode": "AR18_24"
}
Target codes
TargetCodes is an array of 1 or 2 target codes. Each entry produces one
row in Results. Sending more than two codes returns 400.
{
"TargetCodes": ["OMEN", "OWOMEN"]
}
Let's go to examples
Every payload below is synthetic. The shared constants they reuse — the survey, population base, authorizer and target codes — are documented once in the example gallery.
Basic crosstab for two targets, one population base
The default call shape from the Explore API docs. Queries M20F with AR18_24 as the population base and returns results for OMEN (Men) and OWOMEN (Women).
`TargetCodes` accepts 1–2 members. Multiply `WgtAud` by `AudienceReportUnits` for the absolute projected audience. `Stbl` of `0` means stable; `1` means unstable (use with caution).
{
"SurveyCode": "M20F",
"AuthorizationGroup": "_ALL_",
"PopulationBaseCode": "AR18_24",
"TargetCodes": [
"OMEN",
"OWOMEN"
]
}
curl -X POST 'https://engines.api.telmar.com/omg/prd/v1/crosstab' \
-H 'Telmar-Engine-Authorizer: SAMPLE.ENGINE.AUTHORIZER' \
-H 'Content-Type: application/json' \
-d '{
"SurveyCode": "M20F",
"AuthorizationGroup": "_ALL_",
"PopulationBaseCode": "AR18_24",
"TargetCodes": [
"OMEN",
"OWOMEN"
]
}'
{
"ResultCode": 0,
"ResultDescription": "",
"Results": [
{
"Resps": 1000,
"WgtAud": 10000,
"Stbl": 0
},
{
"Resps": 123,
"WgtAud": 4444,
"Stbl": 1
}
],
"AudienceReportUnits": 1000
}
Crosstab for a single target code
Use when you only need one target against the population base — for example a single demographic cut on a dashboard tile.
`Results` always has one entry per target. With a single `TargetCodes` member the array length is 1.
{
"SurveyCode": "M20F",
"AuthorizationGroup": "_ALL_",
"PopulationBaseCode": "AR18_24",
"TargetCodes": [
"OMEN"
]
}
curl -X POST 'https://engines.api.telmar.com/omg/prd/v1/crosstab' \
-H 'Telmar-Engine-Authorizer: SAMPLE.ENGINE.AUTHORIZER' \
-H 'Content-Type: application/json' \
-d '{
"SurveyCode": "M20F",
"AuthorizationGroup": "_ALL_",
"PopulationBaseCode": "AR18_24",
"TargetCodes": [
"OMEN"
]
}'
{
"ResultCode": 0,
"ResultDescription": "",
"Results": [
{
"Resps": 1000,
"WgtAud": 10000,
"Stbl": 0
}
],
"AudienceReportUnits": 1000
}
More than two TargetCodes in one request
This is the most common first failure. `TargetCodes` is capped at two members per call. Split larger universes across multiple requests.
Rejected requests are not billed. Fix the request and retry — retrying unchanged will fail identically.
{
"SurveyCode": "M20F",
"AuthorizationGroup": "_ALL_",
"PopulationBaseCode": "AR18_24",
"TargetCodes": [
"OMEN",
"OWOMEN",
"OTEENS"
]
}
curl -X POST 'https://engines.api.telmar.com/omg/prd/v1/crosstab' \
-H 'Telmar-Engine-Authorizer: SAMPLE.ENGINE.AUTHORIZER' \
-H 'Content-Type: application/json' \
-d '{
"SurveyCode": "M20F",
"AuthorizationGroup": "_ALL_",
"PopulationBaseCode": "AR18_24",
"TargetCodes": [
"OMEN",
"OWOMEN",
"OTEENS"
]
}'
{
"ResultCode": 400,
"ResultDescription": "TargetCodes must contain between 1 and 2 items.",
"error": {
"code": "invalid_target_codes",
"message": "TargetCodes must contain between 1 and 2 items.",
"field": "TargetCodes",
"hint": "Split the request into multiple crosstab calls of at most two targets each."
}
}
Missing or expired authorizer
Check against this when your integration worked yesterday and stopped today. A 401 means the API could not establish who you are — almost always a missing or expired `Telmar-Engine-Authorizer` value.
401 is about identity, 403 is about entitlement. Do not retry a 401 with the same authorizer value: fetch a fresh one from the Developer Portal first. Portal session cookies are not engine credentials and will always produce this error.
{
"SurveyCode": "M20F",
"AuthorizationGroup": "_ALL_",
"PopulationBaseCode": "AR18_24",
"TargetCodes": [
"OMEN",
"OWOMEN"
]
}
curl -X POST 'https://engines.api.telmar.com/omg/prd/v1/crosstab' \
-H 'Telmar-Engine-Authorizer: expired.SAMPLE.AUTHORIZER' \
-H 'Content-Type: application/json' \
-d '{
"SurveyCode": "M20F",
"AuthorizationGroup": "_ALL_",
"PopulationBaseCode": "AR18_24",
"TargetCodes": [
"OMEN",
"OWOMEN"
]
}'
{
"ResultCode": 401,
"ResultDescription": "The Telmar-Engine-Authorizer header is missing, malformed or expired.",
"error": {
"code": "unauthorized",
"message": "The Telmar-Engine-Authorizer header is missing, malformed or expired.",
"hint": "Request a new engine authorizer value from the Developer Portal and retry. Portal session cookies are not accepted."
}
}
Caller is not entitled to the requested survey
You will hit this when the authorizer is valid but your agreement does not cover the survey or authorization group you requested.
This is a commercial boundary, not a bug. Confirm the survey code and authorization group with Sales — no code change will resolve a missing entitlement.
{
"SurveyCode": "RESTRICTED_SURVEY",
"AuthorizationGroup": "_ALL_",
"PopulationBaseCode": "AR18_24",
"TargetCodes": [
"OMEN"
]
}
curl -X POST 'https://engines.api.telmar.com/omg/prd/v1/crosstab' \
-H 'Telmar-Engine-Authorizer: SAMPLE.ENGINE.AUTHORIZER' \
-H 'Content-Type: application/json' \
-d '{
"SurveyCode": "RESTRICTED_SURVEY",
"AuthorizationGroup": "_ALL_",
"PopulationBaseCode": "AR18_24",
"TargetCodes": [
"OMEN"
]
}'
{
"ResultCode": 403,
"ResultDescription": "The caller is not entitled to survey RESTRICTED_SURVEY.",
"error": {
"code": "forbidden_survey",
"message": "The caller is not entitled to survey RESTRICTED_SURVEY.",
"field": "SurveyCode",
"hint": "Contact Sales to add this survey to your agreement."
}
}
What to read next
- OpenAPI document — fetch the live machine-readable spec.
- CORS pre-flight — pre-flight from a browser.
- Endpoint reference — full schemas and status codes.