> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get visitor data

> Returns the activity feed for a visitor. Use this to retrieve visit data Kameleoon collected, such as triggered experiments, personalizations, or targeted segments.



## OpenAPI

````yaml /data.api.json get /visit/visitor
openapi: 3.0.1
info:
  title: Kameleoon Data API
  description: ''
  version: '1.0'
servers:
  - url: https://eu-data.kameleoon.io
  - url: https://na-data.kameleoon.io
  - url: https://eu-data.kameleoon.eu
  - url: https://na-data.kameleoon.eu
security: []
paths:
  /visit/visitor:
    get:
      tags:
        - Visit
      summary: Get visitor data
      description: >-
        Returns the activity feed for a visitor. Use this to retrieve visit data
        Kameleoon collected, such as triggered experiments, personalizations, or
        targeted segments.
      operationId: GET /visit/visitor
      parameters:
        - name: user-agent
          in: header
          required: true
          description: >-
            Not always required. Kameleoon rejects an incoming request if the
            source is a bot or spider, based on [IAB/ABC user-agent filtering
            rules](https://www.iab.com/guidelines/iab-abc-international-spiders-bots-list/).

            Kameleoon uses a single-pass method. You don't need to take specific
            action when sending requests from a web browser using a standard
            library (XHR). However, in other cases, set a custom value for the
            `User-Agent` request header to overwrite the default value the
            library sets.
          schema:
            type: string
            default: kameleoon-docs
        - name: siteCode
          in: query
          description: The Kameleoon project ID.
          required: true
          schema:
            type: string
        - name: currentVisit
          in: query
          description: >-
            Set to <code>true</code> to get data for the current visit. Note: It
            is strongly recommended to provide the <code>visitorCode</code>
            parameter. If not, Kameleoon uses the last visitor code associated
            with the provided <code>mappingValue</code> to retrieve the visit.
          schema:
            type: boolean
            default: false
        - name: maxNumberPreviousVisits
          in: query
          description: >-
            The maximum number of previous visits to return. Note: If you
            provide the <code>mappingValue</code> parameter, Kameleoon performs
            cross-device reconciliation of previous visits. Otherwise, Kameleoon
            uses the provided <code>visitorCode</code>.
          required: true
          schema:
            type: integer
            format: int32
        - name: visitorCode
          in: query
          description: >-
            The visitor code (a unique Kameleoon ID for a visitor). Note: This
            is required if you do not provide the <code>mappingValue</code>
            parameter.
          schema:
            type: string
        - name: mappingValue
          in: query
          description: >-
            The value of the custom data configured as a mapping identifier
            (acts as a cross-device ID). Note: This is required if you do not
            provide the <code>visitorCode</code> parameter.
          schema:
            type: string
        - name: all
          in: query
          description: Set to <code>true</code> to get all available data for a visitor.
          schema:
            type: boolean
            default: false
        - name: staticData
          in: query
          description: >-
            Set to <code>true</code> to get static data events (browser, browser
            version, device type, OS) for a visitor. Note: Kameleoon ignores
            this if the <code>all</code> parameter is <code>true</code>.
          schema:
            type: boolean
            default: false
        - name: page
          in: query
          description: >-
            Set to <code>true</code> to get page data events (URLs viewed) for a
            visitor. Note: Kameleoon ignores this if the <code>all</code>
            parameter is <code>true</code>.
          schema:
            type: boolean
            default: false
        - name: conversion
          in: query
          description: >-
            Set to <code>true</code> to get conversion events for a visitor for
            goals you have set up in your Kameleoon account. Note: Kameleoon
            ignores this if the <code>all</code> parameter is <code>true</code>.
          schema:
            type: boolean
            default: false
        - name: targetingSegment
          in: query
          description: >-
            Set to <code>true</code> to get targeted segment IDs for a visitor.
            Note: This requires the Kameleoon Audiences Explorer add-on or the
            Kameleoon AI-Driven Personalization package. Kameleoon ignores this
            if the <code>all</code> parameter is <code>true</code>.
          schema:
            type: boolean
            default: false
        - name: experiment
          in: query
          description: >-
            Set to <code>true</code> to get targeted experiment IDs and
            variation IDs for a visitor. Note: Kameleoon ignores this if the
            <code>all</code> parameter is <code>true</code>.
          schema:
            type: boolean
            default: false
        - name: weather
          in: query
          description: >-
            Set to <code>true</code> to get weather conditions data
            (temperature, humidity, pressure...) collected by Kameleoon. Note:
            Kameleoon ignores this if the <code>all</code> parameter is
            <code>true</code>.
          schema:
            type: boolean
            default: false
        - name: customData
          in: query
          description: >-
            Set to <code>true</code> to get custom data events for a visitor.
            Note: You can only retrieve custom data not set as "local".
            Kameleoon ignores this if the <code>all</code> parameter is
            <code>true</code>.
          schema:
            type: boolean
            default: false
        - name: product
          in: query
          description: >-
            Set to <code>true</code> to get product events (product EANs viewed)
            for a visitor. Note: Kameleoon ignores this if the <code>all</code>
            parameter is <code>true</code>.
          schema:
            type: boolean
            default: false
        - name: personalization
          in: query
          description: >-
            Set to <code>true</code> to get the targeted personalization IDs and
            variation IDs for a visitor. Note: Kameleoon ignores this if the
            <code>all</code> parameter is <code>true</code>.
          schema:
            type: boolean
            default: false
        - name: geolocation
          in: query
          description: >-
            Set to <code>true</code> to get geolocation data (country, region,
            city, postal code, latitude...) for a visitor. Note: Kameleoon
            ignores this if the <code>all</code> parameter is <code>true</code>.
          schema:
            type: boolean
            default: false
        - name: prettyPrint
          in: query
          description: Set to <code>true</code> for a "pretty" printed response.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: >-
            Successful operation, youngest visits are rendered, of type JSON
            object {&quot;currentVisit&quot;: &lt;current visit&gt;,
            &quot;previousVisits&quot;: &lt;previous visits&gt;}, with
            &lt;current visit&gt; of type &lt;visit&gt;, &lt;previous visits&gt;
            of type JSON array of &lt;visit&gt; and with &lt;visit&gt; = JSON
            object (&quot;currentVisit&quot; optional key)
        '400':
          description: Malformed URL query syntax.
        '401':
          description: >-
            Authentication failed. Either the HTTP header value is malformed, or
            the token is missing or invalid (malformed, expired, or invalid
            signature).
        '403':
          description: Access denied. Forbidden user-agent or restricted resource.
        '429':
          description: Kameleoon rate-limited the request.
        '500':
          description: An unexpected internal error occurred.

````