Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/vemetric/vemetric/llms.txt

Use this file to discover all available pages before exploring further.

Get Project

GET https://api.vemetric.com/v1/project
Returns the data of the project associated with the provided API key.

Authentication

Requires a valid API key in the Authorization header. The project is automatically determined from the API key. See Authentication for details.

Request

No request body or query parameters required. The project is identified from the API key.

Response

project
object
Project data associated with the provided API key.

Example

Request

curl -X GET 'https://api.vemetric.com/v1/project' \
  -H 'Authorization: Bearer vem_your_api_key_here'

Response

200 - Success
{
  "project": {
    "id": "4232882524803099",
    "name": "Vemetric",
    "domain": "vemetric.com",
    "token": "proj_abc123def456ghi789jkl012mno345",
    "createdAt": "2026-02-07T12:00:00.000Z",
    "firstEventAt": "2026-02-07T12:30:00.000Z",
    "hasPublicDashboard": false,
    "excludedIps": ["127.0.0.1"],
    "excludedCountries": ["DE", "AT"]
  }
}
401 - Unauthorized
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or revoked API key"
  }
}

Use Cases

Verify API Key

Use this endpoint to verify that your API key is valid and retrieve the associated project details:
async function verifyApiKey(apiKey) {
  try {
    const response = await fetch('https://api.vemetric.com/v1/project', {
      headers: { 'Authorization': `Bearer ${apiKey}` }
    });
    
    if (!response.ok) {
      throw new Error('Invalid API key');
    }
    
    const { project } = await response.json();
    console.log(`Connected to project: ${project.name}`);
    return project;
  } catch (error) {
    console.error('API key verification failed:', error);
    throw error;
  }
}

Check Data Availability

Check if a project has any tracked events:
async function hasData(apiKey) {
  const response = await fetch('https://api.vemetric.com/v1/project', {
    headers: { 'Authorization': `Bearer ${apiKey}` }
  });
  
  const { project } = await response.json();
  return project.firstEventAt !== null;
}

Multi-Project Dashboard

If you’re building a dashboard that shows data from multiple projects, you can retrieve project details to display metadata:
const projects = [
  { apiKey: 'vem_project1_key', displayName: 'Production' },
  { apiKey: 'vem_project2_key', displayName: 'Staging' }
];

const projectDetails = await Promise.all(
  projects.map(async ({ apiKey, displayName }) => {
    const response = await fetch('https://api.vemetric.com/v1/project', {
      headers: { 'Authorization': `Bearer ${apiKey}` }
    });
    const { project } = await response.json();
    return { ...project, displayName };
  })
);

console.log(projectDetails);

Notes

The token field in the response is the project token used for client-side event tracking. This is different from your API key:
  • API Key (vem_...): Used for server-side API requests, provides read access to analytics data. Keep this secret.
  • Project Token: Used in the client-side SDK to send events to Vemetric. Safe to expose in client-side code.
Project settings like excludedIps and excludedCountries are managed through the Vemetric dashboard. The API only provides read access to these settings.

Analytics Query

Query analytics data for this project

Authentication

Learn about API key authentication