tags:

views:

215

answers:

3

Hello,

I am not sure if this is the correct forum for this question, but I'm not sure where else to ask it.

bit.ly provides stats for links that are generated through their site. However, it does not seem to create stats for links generated through their API.

Can someone tell if me there is a way to see the stats associated with a link generated through the API?

Thank you!

A: 

You need to use the API as an authenticated user so the links appear in your dashboard. Stats are tracked for API links, you just need to know how to get to them.

If you want the stats for a specific bit.ly link regardless of creator, you can add a + to the URL - this link to StackOverflow (http://bit.ly/3UaZQr) has stats at http://bit.ly/3UaZQr+.

ceejayoz
Maybe I should rephrase my question. Why the links I generate through the API not showing up in the "history"?
Again, you need to use the API as an authenticated user (i.e. use an API key) to have them show up in your history. Otherwise, bit.ly doesn't know which account's history to add them to.It works fine for me - my API created links go in my history without trouble.
ceejayoz
A: 

I'm seeing the same thing. I can view the history for a link, say this one: http://bit.ly/info/t3XJe - and the shortening attribution is correct, but this link (created via the API) does not show up in my history.

I'm shortening the link via api.bit.ly using an account login and api key. The response is correct (from bit.ly), the link is shortened, but the only links that show up in my recent RSS feed or on the bit.ly home page are those created via the web interface.

Michael Reed
A: 

When calling the /shorten action of the REST API, you have to add a &history=1 parameter to tell bit.ly to add the URL to the web history for the authenticated user.

For example:

http://api.bit.ly/shorten?version=2.0.1&longUrl=http://cnn.com&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&history=1

Clickable version of above link

Ryan McGeary