Docs > The API >

key/fetch

GET
https://keybase.io/_/api/1.0/key/fetch.json
SAMPLE PARAMS
pgp_key_ids : "6052b2ad31a6631c,980A3F0D01FE04DF"
ops : 3
SAMPLE OUTPUT
{
  "status": {
    "code": 0,
    "name": "OK"
  },
  "keys": [
    {
      "bundle": "-----BEGIN PGP PUBLIC KEY BLOCK----- ..."
      "uid": "dbb165b7879fe7b1174df73bed0b9500",
      "username": "max",
      "key_type": 1,
      "kid": "01013ef90b4c4e62121d12a51d18569b57996002c8bdccc9b2740935c9e4a07d20b40a",
      "self_signed": 1,
      "primary_bundle_in_keyring": 1,
      "self_sign_type": 1,
      "subkeys": {
        "6052b2ad31a6631c": {
          "flags": 47,
          "is_primary": 1
        },
        "980a3f0d01fe04df": {
          "flags": 46,
          "is_primary": 0
        }
      },
      "secret": 0
    }
  ]
}

Fetch a Key by PGP ID

Find as many of the given keys as possible. If an ops parameter is specified (it is optional), then the returned keys must be able to perform the given ops. The ops parameter is a bitmasked-OR of:

  • 0x1 — encrypt
  • 0x2 — decrypt
  • 0x4 — verify
  • 0x8 — sign

If you request a secret key (for either signing or decrypting), you have to be logged in, and the key requested must be yours.