Overview
TheURLStats model represents the internal statistics and metadata for a short URL. This model is returned by endpoints that provide detailed information about a URL’s performance and status.
When to Use
This model is returned by:- GET /details - Retrieve detailed statistics for a short URL
This is a response-only model. You don’t send this data to the API; the API returns it to you.
Schema Definition
The short code identifier for the URL.This is the unique identifier used in the shortened URL path.
The total number of times this short URL has been accessed.Tracking:
- Increments each time someone visits the short URL
- Can be reset using the
/reset_hitsendpoint - Useful for measuring link popularity and reach
The timestamp when the short URL was created.Format: ISO 8601 datetime stringExample:
"2024-03-15T14:30:00.000Z"Timestamps are typically in UTC timezone
The current active state of the short URL.Values:
true- URL is active and accessiblefalse- URL is paused and will not redirect
- Use
/pauseendpoint to set tofalse - Use
/resumeendpoint to set totrue - Paused URLs return an error or info page instead of redirecting
Example JSON Response
Understanding URL States
Active State (true)
Active State (true)
When
url_state is true:- The short URL redirects to the destination URL
- Hit counter increments on each visit
- URL is fully functional and accessible
- This is the default state for newly created URLs
Paused State (false)
Paused State (false)
When
url_state is false:- The short URL does not redirect
- Visitors see an error or informational message
- Hit counter may or may not increment (depends on implementation)
- Useful for temporarily disabling a link without deleting it
Use Cases
Common Scenarios for Checking URL Stats:
- Campaign Tracking - Monitor hits for marketing campaigns
- Performance Analysis - Analyze which links get the most traffic
- Link Management - Check if a URL is active or paused
- Audit Trail - Verify when a URL was created
- Capacity Planning - Understand link usage patterns
Metrics and Analytics
Analyzing URL Hits
Analyzing URL Hits
The
url_hits counter provides basic usage metrics:Insights You Can Gain:- Total reach of your short link
- Popularity comparison between different links
- Traffic trends when combined with creation date
- Does not track unique visitors (counts all visits)
- No geographic or demographic information
- No referrer or device information
State Management Operations
State Management Operations
Control your URL’s active state:
- Pause - Set
url_statetofalse(temporary deactivation) - Resume - Set
url_statetotrue(reactivation) - Check - View current state via
/detailsendpoint
- A campaign has ended
- You need to update the destination URL
- You want to prevent access without deleting the link
Response Headers
When retrieving URL stats, the response typically includes standard HTTP headers with content-type
application/json.Related Endpoints
- Get Details - Returns this model
- Reset Hits - Reset the
url_hitscounter to 0 - Pause URL - Set
url_stateto false - Resume URL - Set
url_stateto true