Docs > The API >

<user>/pgp_keys.asc

CORS Support Yes! AJAX can work from any website.
GET
https://keybase.io/<user>/pgp_keys.asc
SAMPLE OUTPUT
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - https://gpgtools.org

mQINBFJS084BEADG1jpg0YCEakf3VPbQTB8Sgthxh/SlisDcSsIqM33gjINJmWYz
6l8YbLRRfr0bNB1KSiEdCBbbx1eUZ6qlhbE+xXmpnxNkD3pauVyo5KMWMaDVgpDP
HcKH0hSiNmvR+DiOjn9dCQorx1rkB6NHkdKsVaEGPgdDuHTmQM9nRNw5/vTuyHkq
DBCFmYHsouCCDxBsEf0IQmIGabU3d8JWWnWbW1L1f9t/raaO9BIRv8WovsvJKGzw
PU5Qz9g0TQ3edl+tCPXEjj6RYOwGqy3d1LS73mRNTlCuOhwkvOMsfvKH5bwByeM4
60Ib/ZtKfpgop77ZTFyIPcP/YiToe5v2ts4Quwb8wy5akYr1aB4xzN/HucnJ8QGi
HYGNTCpyIIYHaomS4nAqnMhs4UWBE2WF/2rWKCTvWtd3m6jBUgcsP9eazJgUmgKj
hBEz9bsfcLPSH9lnfcj00AgEW8EF9bBNMAYc/BX4hAk0RRhh/dBf9ow4kRZBqgR/
c/f5nyOmCvQK7km5dz9jmMvMBIQZ4cqJP4NrEdRQh/xzio1wk40PKziZQwBlx1mS
iNPRgkeclwCaumxds9671gyHQjEGa7moPHfe/6zvduZ28yzbhq8ydZkfpq6YUrc8
GRtP/isXqlhSJ0dpsYA5njnIJE0GuhkNAYw7PUsLxQH0KP8Obu2ahnnu9wARAQAB
tCJDaHJpcyBDb3luZSA8Y2hyaXNAY2hyaXNjb3luZS5jb20+iQI+BBMBAgAoBQJS
UtPOAhsvBQkHhh+ABgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRD7wH1qlwFs
s6M7D/9UayLmZoIkNY266Wnl6wu5lcpxJ+c7v5/+VQEEmpI++D8HMURiHU+MXVFX
HxQEUm5KcoFDX81hl+G4KKlQlpcnX7QkkF7ZT9FFQj5SeKPkNmQxsqNhQNdfIboT
WcNmrQHcQu/EJRjFdWHpD5wKDFwIrsTNAiVzwMIue69MgDuw3xXJiF2xjM9GvWlI
CPiiOPTWoYCjhR3g0eYqyUTAuSfEkExDarKciBzOjGbOsUz5SjSqOu3GKQDAYhXd
UZ3VVEz+B5kxvggqs8WXo86vzYI1OvGO2N61JysQpnE6dtMmKKh91YYKoEKPY4iz
xSEssQLlCFJMU73eotlgqOwbsjsD/XoWCUvRKzAf4MuL3wsJcc5cdY6wk08GWk71
/Qm74jiAxqSGH/5znmPYfTCzvxcxm4Me9zEbRSmaZscDiZluaImJHErDNXH4CxPl
orP8yaEbTuqDVuJx5DEjnWemCVbN3u1U2FCjxloeV5aOdH3jhlMrCY5mO6rw8Vh/
DI1zro3A7/PJ+tCsj3luJwhthD4TLmZlQqeAqaZ6gNinVGNwSeQT9num0DBUPBtQ
ky44+lS810RL54YxfZ1fMaLCNdVDXaepuCbyusHSBA0Cq1tNioFai1eT
=MqTh
-----END PGP PUBLIC KEY BLOCK-----
WATCH FOR
"404"

Why raw?

This API endpoint does not match our normal JSON API format, but it could be very helpful in scripting/shell scripting.

For example, this short command imports a Keybase user's PGP keys into GPG using just cURL, and not the keybase command line app.

curl https://keybase.io/chris/pgp_keys.asc | gpg --import

Multiple keys possible

If a user has multiple proven PGP keys, this will include all of them in one text file. That still works. If you'd prefer to target one of a user's fingerprints, you may append ?fingerprint={fingerprint} to the URL. For example:

curl https://keybase.io/chris/pgp_keys.asc?fingerprint=94AA3A5BDBD40EA549CABAF9FBC07D6A97016CB3 | gpg --import

CORS

Also note that this API call, along with both user/autocomplete and user/lookup is available via AJAX using CORS. Combining the three, you can search Keybase on any page on the web, present results to a viewer, and let them encrypt or verify.