URL Shortener API

Url: list

Requires authorization

The url.list method retrieves a list of URLs shortened by the authenticated user. Try it now.

The url.list method returns a paginated list of information about short URLs created by a user, sorted in reverse chronological order. Each returned resource contains the short URL, long URL, creation timestamp, and status.

This method requires one query parameter:

  • 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.

It also supports two optional query parameters:
  • The index into the paginated list (using the start-token query parameter). To request successive pages of results, set the start-token parameter to the current result's nextPageToken value.
  • Additional information to return (using the projection query parameter). The only supported values are:
    • "FULL" - returns short URL click counts
    • "ANALYTICS_CLICKS" - returns short URL click counts

Other analytics are not returned by url.list.

Request

HTTP Request

GET https://www.googleapis.com/urlshortener/v1/url/history?key={key}&start-token={startToken?}&projection={projection?}

Parameters

Parameter Name Value Description
Optional Parameters
projection string Additional information to return.

Acceptable values are:
  • "ANALYTICS_CLICKS" - Returns short URL click counts.
  • "FULL" - Returns short URL click counts.
start-token string Token for requesting successive pages of results.

Authorization

This request requires authorization with at least one of the following scopes (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/urlshortener

Request Body

Do not supply a request body with this method.

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "urlshortener#urlHistory",
  "totalItems": integer,
  "itemsPerPage": integer,
  "nextPageToken": string,
  "items": [
    url Resource
  ]
}
Property Name Value Description Notes
kind string The fixed string "urlshortener#urlHistory".
totalItems integer Total number of short URLs associated with this user (may be approximate).
itemsPerPage integer Number of items returned with each full "page" of results. Note that the last page could have fewer items than the "itemsPerPage" value.
nextPageToken string A token to provide to get the next page of results.
items[] list A list of URL resources.

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.