<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/TorControlClient/getInfo(_:)-6m7om",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Tor"
    ],
    "preciseIdentifier" : "s:3Tor0A13ControlClientC7getInfoySDyS2SGSaySSGYaKF"
  },
  "title" : "getInfo(_:)"
}
-->

# getInfo(_:)

Issue a multi-key `GETINFO` command (control-spec.txt §3.9).

```
func getInfo(_ keys: [String]) async throws -> [String : String]
```

## Parameters

`keys`

Info keys to query (e.g. `["version", "status/bootstrap-phase", "net/listeners/socks"]`).

## Return Value

Dictionary mapping each requested key to its
returned value. Missing keys are omitted (Tor responds with
an error reply in that case).

## Discussion

Joins `keys` with spaces and sends `GETINFO k1 k2 …`. Tor replies
with one `250-key=value` line per key; the response is parsed
into a dictionary by [`parseGetInfoResponse(_:)`](/documentation/Tor/ControlProtocolParser/parseGetInfoResponse(_:)).

> Throws: ``doc://Tor/documentation/Tor/TorError/controlProtocolError(code:message:)`` for
> non-success replies (e.g. 552 “unrecognized key”), or
> ``doc://Tor/documentation/Tor/TorError/invalidResponse(_:)`` on malformed output.

> Note: For the full GETINFO key vocabulary see
> control-spec.txt §3.9. swift-tor uses `version`,
> `net/listeners/socks`, and `status/bootstrap-phase` most
> frequently.