File Lookup

get
Lookup public files

https://pagecdn.com/api/v2/public/lookup
This endpoint allows you to search files on Public CDN. You can: --- Search files by URL; --- Search files by sha256 hash; --- Search files in a repo; --- Search minified files. If your input matches library.js, you can request the API to find corresponding minified file library.min.js.
Request
Response
Query Parameters
apikey
required
string
The api key to identify originator of the request.
match
required
string
Specify the lookup method. i.e. sha256 hash or url. URL can be a file on PageCDN, or external host.
hash
optional
string
sha256 hash of the file you want to lookup.
url
optional
string
URL to lookup a matching resource on PageCDN.
repo
optional
string
Specify repo path i.e. lib/jquery if you want to search files only within a specific repo.
optimized
optional
string
Specify if you want the API to return corresponding minified files when available. Set true to enable this feature.
200: OK
Successfully found 1 file.
{
"status": "200",
"message": "Ok",
"details": "Success",
"response": {
"count": 1,
"files": [
{
"repo": "lib/jquery",
"repo_name": "jQuery",
"version": "3.4.0",
"file_hash": "0497a8d2a9bde7db8c0466fae73e347a3258192811ed1108e3e096d5f34ac0e8",
"file_url": "https://pagecdn.io/lib/jquery/3.4.0/jquery.min.js",
"file_size": "88151"
}
]
}
}

Sample Requests

Lookup a file by hash:

https://pagecdn.com/api/v2/public/lookup?match=hash&hash=c32629789d47db041088429024179fa85184d7ea81d818198b8c6d74cfff4787&apikey=160a426ff2894252cd7cebbdd6d6b7da8fcd319c65b70468f10b6690c45d02ef

Lookup a file by its URL:

https://pagecdn.com/api/v2/public/lookup?match=url&url=https%3A%2F%2Fcode.jquery.com%2Fjquery-3.4.0.js&apikey=160a426ff2894252cd7cebbdd6d6b7da8fcd319c65b70468f10b6690c45d02ef

Lookup a minified file:

https://pagecdn.com/api/v2/public/lookup?match=url&url=https%3A%2F%2Fcode.jquery.com%2Fjquery-3.4.0.js&apikey=160a426ff2894252cd7cebbdd6d6b7da8fcd319c65b70468f10b6690c45d02ef&optimized=true

Lookup within a specific repo:

https://pagecdn.com/api/v2/public/lookup?match=url&url=https%3A%2F%2Fcode.jquery.com%2Fjquery-3.4.0.js&apikey=160a426ff2894252cd7cebbdd6d6b7da8fcd319c65b70468f10b6690c45d02ef&repo=lib/jquery&optimized=true