TripGain Analytics API

The Analytics API from TripGain, for analytics.

GitHub OpenAPI

Operations 11

GET /analytics/searchuuid/{searchuuid} Get Results By Searchuuid #
GET /analytics/resultid/{resultid} Get Results By Resultid #
GET /analytics/fare-timeline Fare Timeline Endpoint #
GET /analytics/hotel/daily-total Daily Hotel Search Count #
GET /analytics/hotel/cheapest-nearby Get Cheapest Nearby Hotels #
GET /analytics/hotel/search Search Hotels Ingested #
GET /analytics/flight/date-grid Flight Date Grid Endpoint #
GET /analytics/hotel/date-grid Hotel Date Grid Endpoint #
GET /analytics/hotel/price-history Hotel Price History Endpoint #
GET /analytics/hotel/price-timeline Hotel Price Timeline #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/tripgain-com:tripgain-com-analytics-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

tripgain-com-analytics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Flight Analytics API
  description: Protected with x-session-token
  version: 1.0.0
tags:
- name: Analytics
paths:
  /analytics/searchuuid/{searchuuid}:
    get:
      tags:
      - Analytics
      summary: Get Results By Searchuuid
      operationId: get_results_by_searchuuid_analytics_searchuuid__searchuuid__get
      parameters:
      - name: searchuuid
        in: path
        required: true
        schema:
          type: string
          title: Searchuuid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - SessionToken: []
  /analytics/resultid/{resultid}:
    get:
      tags:
      - Analytics
      summary: Get Results By Resultid
      operationId: get_results_by_resultid_analytics_resultid__resultid__get
      parameters:
      - name: resultid
        in: path
        required: true
        schema:
          type: string
          title: Resultid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - SessionToken: []
  /analytics/fare-timeline:
    get:
      tags:
      - Analytics
      summary: Fare Timeline Endpoint
      description: 'Returns how the fare evolved for a specific journey date.


        Output: list sorted by `search_date`

        ```jsonc

        [

        { "search_date": "2025-06-19", "min_price": 4000, "max_price": 4200,

        "avg_price": 4100, "flights": 36 },

        { "search_date": "2025-06-20", "min_price": 4500, ... },

        ...

        ]

        ```'
      operationId: fare_timeline_endpoint_analytics_fare_timeline_get
      parameters:
      - name: origin
        in: query
        required: true
        schema:
          type: string
          minLength: 3
          maxLength: 3
          title: Origin
        example: BLR
      - name: destination
        in: query
        required: true
        schema:
          type: string
          minLength: 3
          maxLength: 3
          title: Destination
        example: DEL
      - name: jdate
        in: query
        required: true
        schema:
          type: string
          pattern: \d{4}-\d{2}-\d{2}
          title: Jdate
        example: '2025-06-27'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: true
                title: Response Fare Timeline Endpoint Analytics Fare Timeline Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - SessionToken: []
  /analytics/hotel/geo-trends:
    get:
      tags:
      - Analytics
      summary: Get Hotel Geo Trends
      operationId: get_hotel_geo_trends_analytics_hotel_geo_trends_get
      parameters:
      - name: checkin_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: Checkin Date
      - name: min_lat
        in: query
        required: true
        schema:
          type: number
          title: Min Lat
      - name: max_lat
        in: query
        required: true
        schema:
          type: number
          title: Max Lat
      - name: min_lng
        in: query
        required: true
        schema:
          type: number
          title: Min Lng
      - name: max_lng
        in: query
        required: true
        schema:
          type: number
          title: Max Lng
      - name: min_search_date
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Min Search Date
      - name: max_search_date
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Max Search Date
      - name: precision
        in: query
        required: false
        schema:
          type: integer
          maximum: 4
          minimum: 1
          description: Rounding precision for coordinates
          default: 2
          title: Precision
        description: Rounding precision for coordinates
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - SessionToken: []
  /analytics/hotel/daily-total:
    get:
      tags:
      - Analytics
      summary: Daily Hotel Search Count
      operationId: daily_hotel_search_count_analytics_hotel_daily_total_get
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          description: Number of days to fetch
          default: 30
          title: Limit
        description: Number of days to fetch
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - SessionToken: []
  /analytics/hotel/cheapest-nearby:
    get:
      tags:
      - Analytics
      summary: Get Cheapest Nearby Hotels
      operationId: get_cheapest_nearby_hotels_analytics_hotel_cheapest_nearby_get
      parameters:
      - name: lat
        in: query
        required: true
        schema:
          type: number
          description: Latitude of location
          title: Lat
        description: Latitude of location
      - name: lng
        in: query
        required: true
        schema:
          type: number
          description: Longitude of location
          title: Lng
        description: Longitude of location
      - name: checkin_date
        in: query
        required: true
        schema:
          type: string
          format: date
          description: Check-in date
          title: Checkin Date
        description: Check-in date
      - name: radius_km
        in: query
        required: false
        schema:
          type: number
          description: Radius in kilometers
          default: 5.0
          title: Radius Km
        description: Radius in kilometers
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - SessionToken: []
  /analytics/hotel/search:
    get:
      tags:
      - Analytics
      summary: Search Hotels Ingested
      description: 'Search already-ingested hotel data from ClickHouse.

        Returns deduplicated cheapest row per hotel for the given location + dates.'
      operationId: search_hotels_ingested_analytics_hotel_search_get
      parameters:
      - name: lat
        in: query
        required: true
        schema:
          type: number
          description: Latitude of location
          title: Lat
        description: Latitude of location
      - name: lng
        in: query
        required: true
        schema:
          type: number
          description: Longitude of location
          title: Lng
        description: Longitude of location
      - name: checkin
        in: query
        required: true
        schema:
          type: string
          format: date
          description: Check-in date
          title: Checkin
        description: Check-in date
      - name: checkout
        in: query
        required: true
        schema:
          type: string
          format: date
          description: Check-out date
          title: Checkout
        description: Check-out date
      - name: radius_km
        in: query
        required: false
        schema:
          type: number
          maximum: 50.0
          minimum: 0.5
          default: 5.0
          title: Radius Km
      - name: max_price
        in: query
        required: false
        schema:
          anyOf:
          - type: number
          - type: 'null'
          title: Max Price
      - name: min_rating
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            maximum: 5
            minimum: 0
          - type: 'null'
          title: Min Rating
      - name: sort_by
        in: query
        required: false
        schema:
          type: string
          pattern: ^(price|rating)$
          default: price
          title: Sort By
      - name: page
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          default: 1
          title: Page
      - name: size
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 50
          title: Size
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - SessionToken: []
  /analytics/flight/date-grid:
    get:
      tags:
      - Analytics
      summary: Flight Date Grid Endpoint
      description: 'Returns the cheapest price per journey date for the next `days` dates.

        Used by the Price Calendar UI.

        All 21 dates are always returned; missing dates have cheapest_price=null.'
      operationId: flight_date_grid_endpoint_analytics_flight_date_grid_get
      parameters:
      - name: origin
        in: query
        required: true
        schema:
          type: string
          minLength: 3
          maxLength: 3
          title: Origin
        example: BLR
      - name: destination
        in: query
        required: true
        schema:
          type: string
          minLength: 3
          maxLength: 3
          title: Destination
        example: DEL
      - name: days
        in: query
        required: false
        schema:
          type: integer
          maximum: 60
          minimum: 7
          description: Number of journey dates ahead
          default: 21
          title: Days
        description: Number of journey dates ahead
      - name: recency_days
        in: query
        required: false
        schema:
          type: integer
          maximum: 30
          minimum: 1
          description: Use searches from last N days
          default: 7
          title: Recency Days
        description: Use searches from last N days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: true
                title: Response Flight Date Grid Endpoint Analytics Flight Date Grid Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - SessionToken: []
  /analytics/hotel/date-grid:
    get:
      tags:
      - Analytics
      summary: Hotel Date Grid Endpoint
      description: 'Returns the cheapest hotel price per check-in date for the next `days` dates.

        All dates are always returned; missing dates have cheapest_price=null.'
      operationId: hotel_date_grid_endpoint_analytics_hotel_date_grid_get
      parameters:
      - name: lat
        in: query
        required: true
        schema:
          type: number
          description: Latitude
          title: Lat
        description: Latitude
      - name: lng
        in: query
        required: true
        schema:
          type: number
          description: Longitude
          title: Lng
        description: Longitude
      - name: days
        in: query
        required: false
        schema:
          type: integer
          maximum: 60
          minimum: 7
          default: 21
          title: Days
      - name: radius_km
        in: query
        required: false
        schema:
          type: number
          maximum: 50.0
          minimum: 0.5
          default: 5.0
          title: Radius Km
      - name: recency_days
        in: query
        required: false
        schema:
          type: integer
          maximum: 30
          minimum: 1
          default: 7
          title: Recency Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: true
                title: Response Hotel Date Grid Endpoint Analytics Hotel Date Grid Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - SessionToken: []
  /analytics/hotel/price-history:
    get:
      tags:
      - Analytics
      summary: Hotel Price History Endpoint
      description: 'Daily min price for a specific check-in date over the last N days of searches.

        Queries hotel_searches directly — daily granularity, not weekly MV.

        Powers the ''Book Now or Wait?'' trend chart.'
      operationId: hotel_price_history_endpoint_analytics_hotel_price_history_get
      parameters:
      - name: lat
        in: query
        required: true
        schema:
          type: number
          description: Latitude
          title: Lat
        description: Latitude
      - name: lng
        in: query
        required: true
        schema:
          type: number
          description: Longitude
          title: Lng
        description: Longitude
      - name: checkin_date
        in: query
        required: true
        schema:
          type: string
          format: date
          description: Check-in date
          title: Checkin Date
        description: Check-in date
      - name: days_back
        in: query
        required: false
        schema:
          type: integer
          maximum: 60
          minimum: 3
          description: How many days of search history to look back
          default: 14
          title: Days Back
        description: How many days of search history to look back
      - name: radius_km
        in: query
        required: false
        schema:
          type: number
          maximum: 50.0
          minimum: 0.5
          default: 5.0
          title: Radius Km
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - SessionToken: []
  /analytics/hotel/price-timeline:
    get:
      tags:
      - Analytics
      summary: Hotel Price Timeline
      operationId: hotel_price_timeline_analytics_hotel_price_timeline_get
      parameters:
      - name: lat
        in: query
        required: true
        schema:
          type: number
          description: Latitude of location
          title: Lat
        description: Latitude of location
      - name: lng
        in: query
        required: true
        schema:
          type: number
          description: Longitude of location
          title: Lng
        description: Longitude of location
      - name: checkin_date
        in: query
        required: true
        schema:
          type: string
          format: date
          description: Check-in date
          title: Checkin Date
        description: Check-in date
      - name: precision
        in: query
        required: false
        schema:
          type: integer
          maximum: 3
          minimum: 1
          description: Rounding precision for coordinates
          default: 2
          title: Precision
        description: Rounding precision for coordinates
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - SessionToken: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
  securitySchemes:
    SessionToken:
      type: apiKey
      in: header
      name: x-session-token