apioauth-2.0batch-processingbit.ly

Bitly API: batch handling clicks endpoint


I am using the Bitly API to track clicks of Bitly links posted on my network. At the moment I have to track them one by one. In the bitly docs I have read that the best practice is one of making a batch call to the /clicks endpoint. However in the specific docs about the clicks endpoint, nothing is mentioned about batch processing.

Batch Processing The Bitly API does not support shortening more than one long URL with a single API call. However, up to 15 URLs can be handled in one API call using the /v3/lookup, /v3/expand and /v3/clicks endpoints.

Nowhere in the Bitly documentation I can find any example to use batch processing. I did some tries myself, but none worked.

https://api-ssl.bitly.com/v3/link/clicks?access_token=XXXXXXXXXXXX&format=json&link=http%3A//vrt.nu/kijkuniversiteitvanvlaanderen&link=https%3A%2F%2Fbuff.ly%2F2AooMAX

https://api-ssl.bitly.com/v3/link/clicks?access_token=XXXXXXXXXXXX&format=json&link=http%3A//vrt.nu/kijkuniversiteitvanvlaanderen,link=https%3A%2F%2Fbuff.ly%2F2AooMAX

I hope you can help me find the solution.

Thank you and best regards,

Kevin


Solution

  • The Best practices in bitly.com states /v3/clicks instead of /v3/link/clicks. I guess /v3/link/clicks does not support batch process.

    I tried links, link[], duplicate link in /v3/link/clicks. All do not work.

    While /v3/clicks supports duplicate shortUrl. enter image description here

    WARNING: /v3/clicks in deprecated list, it will be deprecated but the official website does not state when it will be deprecated.

    Hope it help.

    reference: https://dev.bitly.com/best_practices.html

    reference: https://dev.bitly.com/deprecated.html#v3_clicks