Skip to main content
Tedi ObservationEntity defines the structure and properties of an observation used in Tedi’s Observations API.

Definition

Below is the definition for the ObservationEntity:
ObservationEntity
interface ObservationEntity {
  id: string;
  api_key_id: string;
  ip: string;
  user_agent: string;
  http_status: number;
  method: string;
  path: string;
  status: "success" | "error";
  metadata?: {
    request: {
      headers: Record<string, any>;
      geo: {
        continent: string | null;
        country: string | null;
        region: string | null;
        postalCode: string | null;
        regionCode: string | null;
        isEUCountry: boolean | null;
        timezone: string | null;
        longitude: number | null;
        latitude: number | null;
      };
    };
    response: {
      headers: Record<string, any>;
    };
    trace?: {
      input: Record<string, unknown>;
      output?:
        | string
        | Array<Record<string, unknown>>
        | Record<string, unknown>
        | null;

      usage?: {
        promptTokens: number;
        completionTokens: number;
        totalTokens: number;
      };
      steps: Array<{
        id: string;
        title: string;
        networkGroup: "seo" | "web";
        status: "success" | "error" | "pending";
        icons: string[];
        input: Record<string, unknown>;
        output?:
          | string
          | Array<Record<string, unknown>>
          | Record<string, unknown>
          | null;
        apiData?: {
          provider: string;
          url: string;
          endpoint: string;
          method: string;
          dataSendMethod: "query" | "body";
        };
        error?: string | null;
        timestamp: string;
      }>;
      error?: string | null;
    };
  };
  created_at: string;
}
PropertyTypeDescription
idstringA unique identifier for the observation.
api_key_idstringThe API key associated with the observation.
ipstringThe IP address from which the request originated.
user_agentstringThe user agent string of the client making the request.
http_statusnumberThe HTTP status code returned for the request.
methodstringThe HTTP method used for the request (e.g., GET, POST).
pathstringThe endpoint path that was accessed.
status”success” | “error”The status of the observation, either “success” or “error”.
metadataobject (optional)Additional metadata about the request and response. See
created_atstringThe timestamp when the observation was created.
metadata Property: The metadata property contains additional information about the request and response associated with the observation. It includes details such as request headers, geographical information, response headers, and a trace of steps taken during the observation process.

Example

Below is an example of an ObservationEntity response:
{
  "status": true,
  "data": {
    "id": "f1b08336-88f6-47a4-b928-2b72c6ab73b7",
    "ip": "213.162.81.221",
    "user_agent": "PostmanRuntime/7.48.0",
    "http_status": 404,
    "method": "GET",
    "path": "/v1/observations/b798f214-dcea-48bf-b25e-19260498c268",
    "status": "error",
    "metadata": {
      "request": {
        "headers": {
          "accept": "*/*",
          "accept-encoding": "gzip, br",
          "authorization": "Bearer [ENCRYPTED]",
          "cache-control": "no-cache",
          "connection": "Keep-Alive",
          "host": "api.evergreens.ai",
          "user-agent": "PostmanRuntime/7.48.0",
          "x-forwarded-proto": "https",
          "x-real-ip": "213.162.81.221"
        },
        "geo": {
          "continent": "EU",
          "country": "AT",
          "region": "Vienna",
          "postalCode": "1010",
          "regionCode": "9",
          "isEUCountry": "1",
          "timezone": "Europe/Vienna",
          "longitude": "16.37208",
          "latitude": "48.20849"
        }
      },
      "response": {
        "headers": {
          "content-type": "application/json"
        }
      },
      "trace": {
        "steps": [
          {
            "id": "tedi_trace_lxFC14ofn8NolfoX6GAmFlEd",
            "title": "Assess search demand and competition in Germany",
            "networkGroup": "ahrefs",
            "status": "success",
            "icons": ["ahrefs"],
            "input": {
              "keywords": "telefonbox",
              "country": "de",
              "select": [
                "keyword",
                "volume",
                "cpc",
                "difficulty",
                "global_volume"
              ],
              "limit": 1000
            },
            "output": [
              {
                "keyword": "telefonbox",
                "volume": 1000,
                "cpc": 800,
                "difficulty": 4,
                "global_volume": 1900
              }
            ],
            "apiData": {
              "provider": "ahrefs",
              "endpoint": "/keywords-explorer/overview",
              "method": "GET",
              "dataSendMethod": "query",
              "url": "https://api.ahrefs.com/v3/keywords-explorer/overview"
            },
            "timestamp": 1760509805563
          }
        ],
        "error": null
      }
    },
    "created_at": "2025-10-08T19:15:03.028Z"
  }
}

Conclusion

The ObservationEntity provides a comprehensive structure for capturing detailed information about observations made through Tedi’s Observations API. It includes essential properties such as request details, response status, and metadata that offer insights into the observation process.