1# @ohos.systemCapability (System Capability) (System API)
2
3System capability (SysCap) refers to a relatively independent feature in the operating system. Different devices provide different system capabilities, and multiple APIs implement a system capability. You can determine whether an API can be used based on system capabilities. This module provides APIs for querying the set of system capabilities.
4
5> **NOTE**
6>
7> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8> - The APIs provided by this module are system APIs.
9
10
11## Modules to Import
12
13```ts
14import systemcapability from '@ohos.systemCapability';
15```
16
17## systemcapability.querySystemCapabilities
18
19querySystemCapabilities(callback: AsyncCallback<string>): void;
20
21Queries system capabilities. This API uses an asynchronous callback to return the result.
22
23**System capability**: SystemCapability.Developtools.Syscap
24
25**Parameters**
26
27| Name| Type| Mandatory| Description|
28| -------- | -------- | -------- | -------- |
29| callback | AsyncCallback<string> | Yes| Callback used to return the result.|
30
31
32**Example**
33
34```ts
35try {
36    systemcapability.querySystemCapabilities((err:Error, data:string) => {
37    if (err == undefined) {
38        console.log("get system capabilities:" + data)
39    } else {
40        console.log(" get system capabilities err:" + err)
41    }});
42}catch(e){
43    console.log("get unexpected error: " + e);
44}
45```
46
47
48## systemcapability.querySystemCapabilities
49
50querySystemCapabilities(): Promise&lt;string&gt;
51
52Queries system capabilities. This API uses a promise to return the result.
53
54**System capability**: SystemCapability.Developtools.Syscap
55
56**Return value**
57
58| Type| Description|
59| -------- | -------- |
60| Promise&lt;string&gt; | Promise used to return the result.|
61
62**Example**
63
64```ts
65try {
66    systemcapability.querySystemCapabilities().then((value:string) => {
67        console.log("get system capabilities: " + value);
68    }).catch((err:Error) => {
69        console.log("get system capabilities error: " + err);
70    });
71}catch(e){
72    console.log("get unexpected error: " + e);
73}
74```
75
76
77> **NOTE**
78>
79> The system capabilities returned by the preceding APIs are in the form of an encoded numeric string.
80