Scale your Experimentation Program with Optimizely’s REST API

When most people think of Optimizely, they picture a visual user interface: filling in forms to create experiments, dragging and dropping content to make variations, and clicking on buttons to track conversions. This visual interface is a great way to get started with experimentation, but what many users don’t realize is that it’s just scratching the surface of what they can do.

With some development work, you can go much deeper. For every feature in our user interface, we expose a corresponding developer API. These APIs allow for much finer-grained control over your experiments, and they make it easy to plug Optimizely into a broader workflow or technology stack. In this series, we’ll walk through how some of the most sophisticated experimentation teams are using our APIs to take their programs to the next level.

Choosing the Right Tool for the Job

The first thing to know about Optimizely’s APIs is that there are several, each designed to enable different use cases. To highlight a few:

  • The REST API lets you create, manage, and monitor your experiments programmatically. It’s the best tool for integrating experimentation into an existing workflow, like your CMS, or building tools to oversee your testing program
  • The Event API lets you track offline conversions – for example, a real-world purchase or call to phone support. It also allows tracking events in a website or app where no Optimizely snippet or SDK is implemented. Another use case is tracking events from third party sources like measuring advertising revenue on a media site.  
  • For client-side testing, the Javascript API allows for customizing how Optimizely runs on your page. You can use it to set up complex event tracking, integrate with tools like tag managers, or carefully control the timing of code execution.
  • For server-side or mobile testing, each Full Stack SDK offers APIs for triggering events, activating experiments, and controlling where and how the SDK runs.

In the upcoming weeks, we’ll do a deep dive into each of these APIs. Today, we’ll start by going into more depth on the REST API.


The REST API allows you to run experiments without ever logging into the Optimizely UI. More broadly, it exposes all the resources in an Optimizely project through a RESTful interface, mirroring the UI as closely as possible but allowing for deeper integrations and scalable automation.

The most common use case for the REST API is integrating with an existing workflow. For example: let’s say you’re a newspaper that wants to A/B test all the headlines on your site, which has been shown to increase click-through rates by over 20%. One way to do this would be to log into Optimizely and create a new experiment for every article you publish. But that can get tedious. Each editor has to step out of their existing workflow, log into a separate tool, get an account, learn how to use the tool, start the experiment, and then remember to check the results later and move forward with the winning variation.

To shortcut this process, media sites like the New York Times are integrating A/B testing directly into their content management systems. Editors write one main headline, and then a few alternative variations right in the same spot. Then, the REST API automatically starts a new experiment with the different headlines. You can see this in action through our WordPress plugin and explore all the PHP source code, or see a simple Python example.

This isn’t just for media sites. We’ve also seen retailers integrate with e-commerce platforms to test out different product descriptions and images, travel sites integrate different offers, etc. This kind of integration is powerful any time you have an existing workflow that could benefit from built in experimentation, like writing Extensions in your local environment and syncing with Optimizely via a command line tool.  Some teams have used integrations to scale their programs to run over 1000 experiments per month.

Another way to use the API is building custom dashboards. You can build your own listing of all the experiments you’re running and tie them to other data that matters to your program, integrating with tools like JIRA or Asana. You can also use our results API to track uplift programmatically. Companies like Atlassian have built internal tooling, including graphs, that allow them to more granularly track lift between product lines.

We’re excited to see what you build with the REST API.  Stay tuned for upcoming blog posts on how to get the most out of the Event API, JavaScript API, and Full Stack SDKs.  

If you have questions or ideas for how we can make our APIs better, drop us a line at