Documentation

This documentation and answers will help you get started and master the way you use PageCDN for better content delivery.

Lookup public files

GEThttps://pagecdn.com/api/v2/public/lookupCopy

This endpoint allows you to search files on Public CDN. With this endpoint, you can:

  • Search files by external URLs;
  • Search files by sha256 hash;
  • Search files in a repo or search the entire Public CDN;
  • Search minified files. For example, if your input matches library.js, you can request the API to find corresponding minified file library.min.js.

Note: PageCDN now supports on-the-fly CSS and JS minification. So, you can now use .min.css and .min.js with all CSS and JS files. If a minified file is not already available in the library, PageCDN will minify it for you. This feature is also available for your private content.

Query String Parameters

apikeystringrequiredThe api key to identify originator of the request.
matchstringrequiredSpecify the lookup method. This can either be hash or url.
hashstringoptionalsha256 hash of the file you want to lookup. Hash is required if you specified hash as lookup method.
urlstringoptionalURL to lookup a matching file on PageCDN. URL can be URL of a file on PageCDN, or an external URL. URL is required if you specified url as lookup method.
repostringoptionalIf you want to search files within a specific repo only, specify repo path as lib/jquery.
optimizedstringoptionalSpecify if you want the API to return corresponding minified files when available. Set true to enable this feature.

Successful Response

 {
    "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 external 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&optimized=true&apikey=160a426ff2894252cd7cebbdd6d6b7da8fcd319c65b70468f10b6690c45d02ef 

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&repo=lib/jquery&optimized=true&apikey=160a426ff2894252cd7cebbdd6d6b7da8fcd319c65b70468f10b6690c45d02ef