Skip to main content
Query events use Google Topics-style category paths like /Shopping/Apparel/Footwear.
If you only need first-level categories, use the list below.

Authentication

GET /v1/sync/categories requires:
  • Authorization: Bearer <api_token>

First-level categories

Category
Arts & Entertainment
Autos & Vehicles
Beauty & Fitness
Books & Literature
Business & Industrial
Computers & Electronics
Finance
Food & Drink
Games
Hobbies & Leisure
Home & Garden
Internet & Telecom
Jobs & Education
Law & Government
News
Online Communities
People & Society
Pets & Animals
Real Estate
Shopping
Sports
Travel & Transportation

Endpoint

Use GET /v1/sync/categories with a table value:
  • searches
  • browsing
  • youtube
  • ads
  • receipts

Response example

{
  "categories": [
    "/Shopping/Apparel/Footwear",
    "/Sports/Running & Walking",
    "/Computers & Electronics/Software"
  ]
}

Example implementation

async function getFirstLevelCategories(table: 'searches' | 'browsing' | 'youtube' | 'ads' | 'receipts') {
  const response = await fetch(
    `https://query.emergedata.ai/v1/sync/categories?table=${table}`,
    {
      headers: {
        Authorization: `Bearer ${process.env.EMERGE_API_TOKEN ?? ''}`
      }
    }
  );

  if (!response.ok) {
    const body = await response.text();
    throw new Error(`Categories request failed (${response.status}): ${body}`);
  }

  const payload: { categories: string[] } = await response.json();
  const roots = Array.from(
    new Set(
      payload.categories
        .map((path) => path.replace(/^\/+/, '').split('/')[0]?.trim())
        .filter((value): value is string => Boolean(value))
    )
  );

  return roots.sort();
}

Gotchas

  • Category filters are subtree matches. /Shopping includes /Shopping/....
  • category can be null on some records. Handle missing values in downstream logic.
  • Keep filtering server-side where possible to reduce payload size.