Platform Allowances

This page summarizes your allowances and limits when working with the Media Strategies API.

Media Strategy API allowances

Your allowance for the Media Strategies API is based upon your package for the PYLON data source you are analyzing.

For example, if you run strategies to analyze LinkedIn engagement data, then the number of these tasks you can run in an hour depends on your package for the PYLON for LinkedIn Engagement Insights product.

Strategy cost

When you run a strategy, the strategy itself will run analysis tasks to collect data for the analysis. Therefore, the cost of running a strategy is expressed by the number of analysis tasks that are required to complete the analysis.

Running a strategy consumes from your limits for running analysis tasks on the related PYLON product.

The LinkedIn top_urls strategy costs 3 analysis tasks, as the strategy will carry out three analysis tasks to retrieve the required data for the analysis. If you run this strategy 3 analysis tasks will be consumed from your PYLON for LinkedIn Engagement Data analysis task limit.

You can see the number of analysis tasks consumed by a strategy task when you retrieve a strategy task from the API:

{
    "usage": {
        "analysis_tasks": 3
    }
}

In this case the task has consumed 3 analysis tasks so far.

Task throughput

The number of strategy tasks you can run in an hour can be calculated from the number of analysis tasks your package allows.

If your package provides one 'slot' for the PYLON for LinkedIn Engagement Insights product, this allows provides you with 160 analysis tasks per hour. This would allow you to run 53 top_urls strategy tasks per hour as they each would cost 3 analysis tasks.

Task queue limit

The number of 'slots' included in your account package determines the number of strategy tasks you can queue for processing. For each 'slot' you can queue up to 200 tasks.

Task queue limit = (number of slots) x 200

If you hit your queue limit you will need to wait for tasks on your queue to be processed before you can add more.

You can see the status of your queue through the following headers that are returned when you POST a new task for processing:

  • X-Strategy-Tasks-Queued - the number of strategy tasks you currently have queued.
  • X-Strategy-Tasks-Queue-Limit - the number of strategy tasks you can queue (as dictated by your package).

General API rate limit

For all calls to the REST API you are subject to the general API rate limit.

Full details of this limit are available on the API Rate Limiting page.

API status codes and error messages

During your usage of the API you might see the following status codes and error messages.

Status code Example messages Explanation
400 Bad Request <Description of error>

Your call to the API contains invalid parameters. The error message will explain the parameter that is invalid in your request, such as a parameter that is not supported by a strategy.

Check that your call matches the API endpoint documentation for the endpoint you are calling. If you are queueing a new strategy task check that the parameters you provide are supported by the strategy, and in the format you are using.

401 Unauthorized Authorization failed

Either you did not provide a username & api key for you call to the API, the username and api key combination is not a valid account, or the identity api key you gave does not have access to the Media Strategies API.

Check that you are providing your username and a valid identity API key.

404 Not Found API endpoint not found

You tried to call an API endpoint that does not exist.

Check that your call matches the API endpoint documentation.

429 Too Many Requests Queue limit reached - you have queued the maximum number of strategy tasks that is permitted for your account.

You have reached the maximum number of tasks for your queue.

You will need to wait for tasks to be processed before queuing more tasks.

Exceeded API rate limit.

You have exceeded your 'General API rate limit'.

If you see this error it's most likely you're making too many calls to check the status of tasks. Consider decreasing the frequency of your requests, or implementing an expontential backoff approach.