LiSA Social Commerce
Developers
Developers
  • Developers
  • Guides
    • Integration Guide
      • Web Integration
      • App Integration
        • Android
          • Communication
          • Storage
          • File Downloads
          • Theming
        • iOS
          • Communication
          • Storage
          • File Downloads
          • Theming
        • React Native
          • Communication
          • Storage
          • File Downloads
          • Theming
        • Picture in Picture
      • Entrypoints
        • Query Parameter (v1)
    • Player Communication
      • Message API Reference
        • App
          • App — Heartbeat
          • App — Message Acknowledge
          • App — Message Error
          • App — Listen
        • CTA
          • CTA — Link in Comments
          • CTA — Sponsor Badge
        • Cart — View Cart
        • Comments — Join
        • Media
          • Media — Complete
          • Media — Pause
          • Media — Progress
          • Media — Resume
        • Media Item
          • Media Item — Emoji
          • Media Item — Impression
        • Player
          • Player — Dismiss
          • Player — Native Picture-in-Picture (PiP)
          • Player — Pass Visual Viewport
          • Player — Request Visual Viewport
          • Player — UI Transition
        • Products
          • Products — Add to Cart
          • Products — Add to Wishlist
          • Products — Click
          • Products — Close Product List
          • Products — Emoji
          • Products — Emoji State Update
          • Products — Impression
          • Products — Open Product List
        • Stickers
          • Stickers — Activate
          • Stickers — Click
          • Stickers — Expire
          • Stickers — Impression
          • Stickers — Publish
          • Stickers — Unlock
          • Stickers — Unpublish
          • Stickers — Update
          • Stickers — Voucher Claim
        • Visitor — Pass User Context
        • Shared Legacy Message Properties
    • Products
      • Product Update Notification API
  • Widgets
    • Content Hub
    • Quick Start Guide
    • Appearance
      • Markup
      • Responsive design
    • Configuration options
      • Autoplay
      • Channel
      • Client
      • Data
      • Debug
      • Host node
      • Layout
      • Language
      • On
      • Player
      • Query string
      • Quick view
      • Sections
      • Store
      • Template
    • API reference
      • Library API reference
      • Player API reference
      • Quick View API reference
    • Customisations
      • Template
      • Bring your own template
      • Type definitions
    • Examples
    • Type definitions
      • Asset
      • Product
      • Other
    • Promo Widget
      • Quick Start Guide
      • Configuration options
        • Autoplay
        • Channel
        • Countdown (deprecated)
        • Enabled
        • Image modifier
        • Lead time
        • Live (deprecated)
        • Position
        • Replay (deprecated)
        • Show ID
        • URL
  • Media Player Introduction
    • Picture-in-Picture Mode
  • Analytics
  • REST API
    • Authentication
    • Rate limits
    • Response status and error codes
    • API Documentation
Powered by GitBook
On this page
  • Rate limits header
  • Avoiding rate limit errors
  1. REST API

Rate limits

Every day many hundrets of clients and developers make requests to the LiSA API. To help manage the volume of these requests, limits are placed on the number of requests that can be made. These limits help us provide the reliable and scalable API that our valued customers rely on.

The maximum number of requests that are allowed is based on a time interval, some specified period or window of time. The most common request limit interval is one minute. If an endpoint has a rate limit of 60 requests per minute, then up to 60 requests over any one-minute interval is allowed.

Past the limit, the API will return a 429 Too Many Requests error.

Rate limits header

You can check how many requests you’ve already made using the X-RateLimit-Remaining header that was sent in response to your API request. This header lists how many requests you're eligable to make before exceeding the limit. For example:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 34
X-RateLimit-Reset: 5

In this example, 26 is the current request count and 60 is the maximum allowed size.

A 429 response will also include a Retry-After header with the number of seconds to wait until retrying your query.

Retry-After header

When a request goes over a rate limit, a 429 Too Many Requests error and a Retry-After header are returned. The Retry-After header contains the number of milliseconds to wait until you can make a request again. Any request made before the wait time has elapsed is throttled.

X-RateLimit-Remaining: 0
Retry-After: 60000

Avoiding rate limit errors

Designing your app with best practices in mind is the best way to avoid throttling errors. For example, you can stagger API requests in a queue and do other processing tasks while waiting for the next queued job to run. Consider the following best practices when designing your app:

Optimize your code to only get the data that your app requires. Use caching for data that your app uses often. Regulate the rate of your requests for smoother distribution. Include code that catches errors. If you ignore these errors and keep trying to make requests, then your app won’t be able to gracefully recover. Use metadata about your app’s API usage, included with all API responses, to manage your app’s behavior dynamically. Your code should stop making additional API requests until enough time has passed to retry. The recommended backoff time is 1 second.

For moderate to high traffic environments, we highly recommend to use the LiSA Proxy API only.

Other LiSA APIs should be consumed by background processes, that pull data from the LiSA services on demand (as per LiSA API notification) or per scheduled job. Traffic from you production environments should not be passed 1:1 to the LiSA APis.

PreviousAuthenticationNextResponse status and error codes

Last updated 1 year ago