URL Shortener API

Url: get

The url.get method gets expansion information for a specified short URL. Try it now.

For the given short URL, the url.get method returns the corresponding long URL and the status.

This method requires two query parameters:

  • Your API key (using the key query parameter). Note: You can omit the query parameter when making a limited number of calls, such as during the testing phase.
  • The short URL (using the shortUrl query parameter). Note: The short URL should include the protocol, e.g. "http://goo.gl/fbsS".

It also supports an optional query parameter:
  • Additional information to return (using the projection query parameter). Possible values are:
    • "FULL" - returns the creation timestamp and all available analytics
    • "ANALYTICS_CLICKS" - returns only click counts
    • "ANALYTICS_TOP_STRINGS" - returns only top string counts (e.g. referrers, countries, etc)

Note that with the projection parameter, analytics might not be returned if data is currently unavailable.

Request

HTTP Request

GET https://www.googleapis.com/urlshortener/v1/url?key={key}&shortUrl={shortUrl}&projection={projection?}

Parameters

Parameter Name Value Description
Required Parameters
shortUrl string The short URL, including the protocol.
Optional Parameters
projection string Additional information to return.

Acceptable values are:
  • "ANALYTICS_CLICKS" - Returns only click counts.
  • "ANALYTICS_TOP_STRINGS" - Returns only top string counts.
  • "FULL" - Returns the creation timestamp and all available analytics.

Request Body

Do not supply a request body with this method.

Response

If successful, this method returns an Url resource in the response body.

Try It!

Use the explorer below to call this method on live data and see the response. Alternatively, try the standalone explorer.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.