GET
/
links
/
:id
Available on Business, Enterprise plans.Max Pack required

Return analytics for all shortened links or a single link for a given link ID. For example:

  • https://api.ayrshare.com/api/links/yC0fTl returns analytics for ID yC0fTl
  • https://api.ayrshare.com/api/links returns all link analytics.

Header Parameters

Authorization
string
required
API Key of the Primary Profile.

Format: Authorization: Bearer API_KEY

Path Parameters

id
string

Provide the shortened link ID returned from the POST /links request as a path parameter. For example: https://api.ayrshare.com/api/links/yC0fTlIf no link ID is provided, all links are returned.

Query Parameters

fromCreatedDate
string

Get history of links shortened after this date. Accepts a UTC date time. For example, use format YYYY-MM-DDThh:mm:ssZ and send as 2023-07-08T12:30:00Z.

toCreatedDate
string

Get history of links shortened before this date. Accepts a UTC date time. For example, use format YYYY-MM-DDThh:mm:ssZ and send as 2023-07-08T12:30:00Z.

fromClickDate
string

Get history of links clicked after this date. Accepts a UTC date time. For example, use format YYYY-MM-DDThh:mm:ssZ and send as 2023-07-08T12:30:00Z.

toClickDate
string

Get history links clicked after this date. Accepts a UTC date time. For example, use format YYYY-MM-DDThh:mm:ssZ and send as 2023-07-08T12:30:00Z.