Skip to main content
The MileIQ External API is currently is available on a request basis.

Welcome to the MileIQ External API

The MileIQ External API allows you to integrate MileIQ’s powerful mileage tracking capabilities into your own applications. This API provides access to valuable data from the MileIQ platform, enabling you to enhance your services with accurate mileage information.

Base URL

MileIQ’s External API is built on REST principles and is served over HTTPS. To ensure data privacy, unencrypted HTTP is not supported. The Base URL for all API endpoints is:

Available Data

Through our API, you can access various types of data, including:
  • User information
    • Name
    • Email
  • Drive information
    • Distance
    • Duration
    • Classification (Business, Personal)
    • Purpose of trip
  • Team information
    • Name
    • Members (with their permissions)

Authentication

MileIQ uses OAuth 2.1 to authenticate and authorize API requests.

Prerequisites

  • A server-side application reachable over HTTPS with at least one public redirect (callback) endpoint.
  • Familiarity with the OAuth 2.0 Authorization Code flow.
  • A Client ID and Client Secret issued by MileIQ for your application.
  • A registered Redirect URI that exactly matches what you will send during authorization.
If you do not yet have credentials, apply for access:

Request API Access

Apply to get started

High-level flow

  1. Your application redirects the user to the MileIQ authorization endpoint with response_type=code, your client_id, requested scope, and a CSRF-protecting state value.
  2. After the user grants consent, MileIQ redirects back to your redirect_uri with an authorization code and the original state.
  3. Your backend exchanges the code for an access token (and optionally a refresh token) at the token endpoint.
  4. Your backend calls MileIQ APIs with the access token in the Authorization: Bearer <token> header.
  5. When the access token expires, use the refresh token to obtain a new one.

Security recommendations

  • Store the Client Secret outside your codebase (e.g., environment variables or a secrets manager).
  • Validate the state parameter on callback to prevent CSRF.
  • Serve all OAuth endpoints over HTTPS.
  • Limit scopes to the minimum required.
  • Prefer short token lifetimes and handle token refresh gracefully.

Example: Python (Flask) OAuth 2.0 Authorization Code Flow

This sample is intentionally minimal to illustrate the flow. It uses in-memory state for demo purposes—replace with a proper session store (e.g., signed server-side sessions, Redis) in production.

Response Codes

The API returns standard HTTP response codes to indicate the success or failure of an API request. Here are a few examples:

Rate Limiting

Read more about rate limiting.