Identify what a Reddit URL points to
Resolve a Reddit URL into the backend target and normalized input needed to call the matching endpoint.
/resolve-url-type Utility https://api.fetchlayer.dev/reddit/resolve-url-type Headers
Authorization string required Bearer token — your FetchLayer API key.
Parameters
url string required Full Reddit URL.
Response Fields
resolve-url-type
Identify what a Reddit URL points to
inputUrl string URL supplied by the caller.
normalizedUrl string Normalized absolute Reddit URL.
target string Resolved backend target, such as post or comment_permalink.
targetInput object Input object to send to the resolved endpoint.
subreddit string | null Resolved subreddit name.
username string | null Resolved username.
postId string | null Resolved post ID.
commentId string | null Resolved comment ID.
query string | null Resolved search query.
sort string | null Resolved sort value.
time string | null Resolved time filter.
Request
curl -X POST "https://api.fetchlayer.dev/reddit/resolve-url-type" \
-H "Authorization: Bearer ss-your-key" \
-H "Content-Type: application/json" \
-d '{"url":"https://www.reddit.com/r/programming/comments/abc123/"}'Response
{
"inputUrl": "https://www.reddit.com/r/programming/comments/abc123/",
"normalizedUrl": "https://www.reddit.com/r/programming/comments/abc123/",
"target": "post",
"targetInput": {
"url": "https://www.reddit.com/r/programming/comments/abc123/"
},
"subreddit": "programming",
"postId": "abc123",
"commentId": null,
"username": null,
"query": null,
"sort": null,
"time": null
}