

# Using the Amazon Cost Explorer API
<a name="ce-api"></a>

The Cost Explorer API allows you to programmatically query your cost and usage data. You can query for aggregated data such as total monthly costs or total daily usage. You can also query for granular data, such as the number of daily write operations for DynamoDB database tables in your production environment.

If you use a programming language that Amazon provides an SDK for, we recommend that you use the SDK. All the Amazon SDKs greatly simplify the process of signing requests and save you a significant amount of time when compared with using the Amazon Cost Explorer API. In addition, the SDKs integrate easily with your development environment and provide easy access to related commands.

For more information about available SDKs, see [Tools for Amazon Web Services](http://www.amazonaws.cn/tools). For more information about the Amazon Cost Explorer API, see the [Amazon Billing and Cost Management API Reference](https://docs.amazonaws.cn/aws-cost-management/latest/APIReference/).

## Service endpoint
<a name="ce-endpoint"></a>

The Cost Explorer API provides the following endpoint:

https://ce.cn-northwest-1.amazonaws.com.cn

## Granting IAM permissions to use the Amazon Cost Explorer API
<a name="ce-iam"></a>

A user must be granted explicit permission to query the Amazon Cost Explorer API. For the policy that grants the necessary permissions to a user, see [View costs and usage](billing-example-policies.md#example-policy-ce-api). 