A simple counting and A/B testing API.

We give you the research tools you need, and get out of the way.

There are a lot of advanced AB testing and tracking tools online. However, they're frequently too advanced, too complicated, too time consuming to integrate, and too expensive.

Count.io is a simple, RESTful, AB testing and tracking API. No compulsory WYSIWG editors, widgets, plugins, or SDKs here.

There are two main sections to count.io: Counting (tracking) and A/B Testing. The API is simple, and we think you'll love it.

Count clicks, impressions, sales, conversions, views, downloads, button pushes, whatever you want. Marketers sometimes call this kind of counting "tracking," but we just call it counting.

It's incredibly simple. The API follows a pattern like this:

https://api.count.io/1/count/{group}/{item}[+/-]

Increment

To count "apples" simply make a POST request like this:

https://api.count.io/1/count/fruit/apples+

Notice the + sign on the end of the URL.

Returns this JSON:

{
   "item": "apples",
   "count": 1,
   "group": "fruit"
}

Use the "group" field to tie similar themed counts together. In this case it's "fruit."

If you call the URL again, you'll notice the count is incremented by 1.

{
   "item":"apples",
   "count":2,
   "group":"fruit"
}

To increment by more than one, include the amount after the "+" sign in the URL, like this:

https://api.count.io/1/count/fruit/apples+2

You can also decrement the count by using a "-" sign instead of a "+" at the end of the URL.

Try a few commands here on Apigee's web console.

Pixel Tracking

We recommend using POST requests whenever possible, but if you're unable to make POST request, you can increment a count using a GET request by adding ".png" to the end of the URL.

Adding the example img tag below to a webpage will increment the count evey time the page is loaded.

<img src="https://api.count.io/1/count/fruit/apples+.png">

This method returns a 1x1 transparent png image.

Get Count

To retrieve a count without incrementing or decrementing, make a GET request and do not include a + or - sign on the end of the URL, like this:

https://api.count.io/1/count/fruit/apples/

Get Group Sum

You can even GET a sum of all the items in your "group" like this:

https://api.count.io/1/count/fruit/

Returns this JSON:

{
   "group":"fruit",
   "sum":7,
   "counts":[
      {
         "item":"apples",
         "count":2
      },
      {
         "item":"oranges",
         "count":1
      },
      {
         "item":"bananas",
         "count":4
      }
   ]
}

Delete Count

You can delete a count by making a HTTP DELETE request like this:

https://api.count.io/1/count/fruit/apples

Returns this JSON:

{"message":"Count deleted successfully."}

Count your A/B Test impressions and conversions with count.io and we'll calculate the statistical significance of your test and help you pick the winning variation.

The A/B Testing API follows a pattern like this:

https://api.count.io/1/ab/{your-tests-name}/{variation}/[impression|conversion][+|-]

Impressions

Let's count impressions for a test called "my-ab-test" that has 3 variations: "original," "blue-button," and "red-button."

To do that, make POST requests like this:

https://api.count.io/1/ab/my-ab-test/original/impression+
https://api.count.io/1/ab/my-ab-test/blue-button/impression+
https://api.count.io/1/ab/my-ab-test/red-button/impression+

To increment or decrement by a specific amount, include the amount after the + or - sign in the URL, just like the basic counting endpoints. You can also use GET requests by adding .png to the end of URL.

Conversions

Counting conversions works just like impressions, but the URL ends with "conversion" instead of "impression."

https://api.count.io/1/ab/my-ab-test/original/conversion+
https://api.count.io/1/ab/my-ab-test/blue-button/conversion+
https://api.count.io/1/ab/my-ab-test/red-button/conversion+

Variation Totals

You can GET the total impressions, converions, and conversion rate for a specific variation like this:

https://api.count.io/1/ab/my-ab-test/original/

Returns this JSON:

{
    "test": "my-ab-test",
    "variation": "original",
    "impressions": 1000,
    "conversions": 150,
    "coversion_rate": 0.15
}

Results

GET your test results at any time like this:

https://api.count.io/1/ab/my-ab-test/

Returns this JSON:

{
    "test": "my-ab-test",
    "variations": {
        "original": {
            "impressions": 1000,
            "conversions": 150,
            "probability_best": 0.04,
            "conversion_rate": 0.15
        },
        "blue-button": {
            "impressions": 1000,
            "conversions": 200,
            "probability_best": 87.48,
            "conversion_rate": 0.2
        },
        "red-button": {
            "impressions": 1000,
            "conversions": 180,
            "probability_best": 12.48,
            "conversion_rate": 0.18
        }
    }
}

The "probability_best" field is the estimated probability, as a percentage, that that variation will generate the most conversions. It is calculated using Bayesian statistics. In our test above, there's an 87% probability that the "blue-button" will perform the best.

Results Charts

Need some charts and graphs to present your test results? No problem! Just send your coworkers and clients this HTML link:

Coming Soon!

  • All URLs are public. We recommend adding a GUID to your "group" and "test" names to avoid collisions with other users.
  • The "1" in the URL represents the version of the API.
  • All URLs and variables are case-sensitive.
  • If a URL is not updated or read after 48 hours, its data may be deleted. URLs updated or read by paid plans survive longer.
  • All endpoints are rate limited.

Count.io is free to use, and most endpoints do not require authentication. However, if you've upgraded to a professional plan, you'll want to authentication your API requests to gain access to your premium features.

  1. First, login to your account and create an "Access Token" via your Account page.
  2. Finally, add a header to all of your API requests with the key name "Authorization" with a value of "Bearer access-token" where access-token is the actual token you created in step 1.

That's it! Keep your access tokens private. If you lose control of a token, delete it and create a new one via your Account page.

The "rate limit" is the amount of times you may access the count.io API per day.

The rate limit for your request can be found in the response header as X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.

Free accounts and anonymous users are limited to 50 requests per day, per end-point.

Increase your rate limit by upgrading your account here.