# [To be offline] Retrieve accelerated domain traffic usage information - GetUcdnDomainTraffic

## Overview

Obtain the usage information of the accelerated domain name

 > 💡 This interface is about to be deprecated, use GetUcdnDomainBandwidthV2 to get domain traffic data.

 > ℹ️ Note<br />The traffic usage data is retained for a maximum of 3 months.


## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `GetUcdnDomainTraffic`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.genesissai.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ProjectId** | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the [GetProjectList interface](/docs/api/summary/get_project_list). |No|
| **AccountType** | string | Specify whether to query by project or by the entire account. The value 'top' means to query by the entire account, and the value 'org' means to query by project. |No|
| **DomainId.N** | string | Domain ID, generated when creating an accelerated domain, n starts from the natural number 0. Default all domains. |No|
| **Areacode** | string | The query traffic area 'cn' represents domestic, 'abroad' represents overseas, the default is all areas. |No|
| **BeginTime** | int | The start date of the query, in Unix Timestamp format. If there is an EndTime, BeginTime must be assigned. |No|
| **EndTime** | int | The end date of the query, formatted as Unix Timestamp. EndTime defaults to the current time, while BeginTime defaults to one day before the current time. |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **TrafficSet** | array[[*UcdnDomainTrafficSet*](#ucdndomaintrafficset)] | Traffic instance table, see UcdnDomainTrafficSet for specific structure. |No|

#### Data Model


#### UcdnDomainTrafficSet

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Time** | int | The time point of traffic acquisition, formatted as Unix Timestamp. |No|
| **Value** | float | Query the total daily traffic, unit: GB |No|

## Example

### Request Example
    
```
http://api.genesissai.com/?Action=GetUcdnDomainTraffic
&ProjectId=org-xxxxx
&DomainId.0=ucdn-xxx
&BeginTime=1420992000
&EndTime=1421166064
&Areacode=cn
&AccountType=CjFxZeTe
&AccountType=THIOdFPl
```

### Response Example
    
```json
{
  " TrafficSet": [
    {
      "Time": " 1399305600",
      "Value": 10.08
    },
    {
      "Time": " 1399392000",
      "Value": 10.08
    },
    {
      "Time": " 1399392000",
      "Value": 10.08
    }
  ],
  "Action": "GetUcdnDomainTrafficResponse",
  "RetCode": 0
}
```





