# 快速入门

本页将引导您从新建账户到发出第一个可用的 API 请求。

## 创建账户

在 [app.tomba.io/auth/register](https://app.tomba.io/auth/register) 注册。新账户从 Free 套餐开始；其每月额度列于[积分和用量](/usage-and-quotas#quotas)中。

## 获取 API 密钥和 Secret

每个请求都需要 2 个凭据：API 密钥和您账户的 Secret。

1. 在仪表板中打开 [API keys](https://app.tomba.io/api)。
2. 创建一个密钥，或复制现有密钥。密钥以 `ta_` 开头。
3. 从同一页面复制您的 Secret。Secret 以 `ts_` 开头。
4. 将两者存储为环境变量，避免写入代码中：

```bash
export TOMBA_API_KEY="ta_xxxx"
export TOMBA_SECRET_KEY="ts_xxxx"
```

密钥会过期。有关到期和轮换，请参阅[认证](/authentication#key-expiry)。

## 发出第一个请求

查找 Tomba 已知的某个公司域名下的邮箱地址：

```bash
curl "https://api.tomba.io/v1/domain-search?domain=stripe.com" \
  -H "X-Tomba-Key: $TOMBA_API_KEY" \
  -H "X-Tomba-Secret: $TOMBA_SECRET_KEY"
```

成功的响应会在 `data.organization` 中返回公司信息，在 `data.emails` 中返回邮箱地址，在 `meta` 中返回分页信息。精简后的响应如下：

```json
{
    "data": {
        "organization": {
            "website_url": "stripe.com",
            "organization": "Stripe",
            "location": {
                "country": "US",
                "city": "San Francisco",
                "state": "California"
            },
            "industries": "Financial Services",
            "pattern": "{first}",
            "accept_all": false
        },
        "emails": [
            {
                "email": "john@stripe.com",
                "first_name": "John",
                "last_name": "Doe",
                "position": "Software Engineer",
                "department": "engineering",
                "type": "personal",
                "score": 90,
                "verification": {
                    "date": "2025-01-15T00:00:00Z",
                    "status": "valid"
                }
            }
        ]
    },
    "meta": { "total": 1250, "pageSize": 10, "current": 1, "total_pages": 125 }
}
```

[公司响应](/attributes/company)和[人员响应](/attributes/person)介绍了每个字段。

如果请求失败，响应中将包含 `errors` 对象。[错误](/error-handling)列出了每种错误类型及其处理方法。所有端点及其参数和响应结构都在 [API 参考](/api)中。

## 仪表板

| 任务                                           | 位置                                                          |
| ---------------------------------------------- | -------------------------------------------------------------- |
| 创建、重命名和撤销 API 密钥            | [API keys](https://app.tomba.io/api)                           |
| 查看剩余积分                        | [Usage](https://app.tomba.io/usage)                            |
| 查看单个 API 请求                 | [Request history](https://app.tomba.io/usage/requests)         |
| 查看当前的速率限制                   | [Rate limits](https://app.tomba.io/api/rate-limits)            |
| 更改套餐或账单信息                 | [Subscription](https://app.tomba.io/settings/subscription)     |
| 配置线索 webhook                        | [Webhooks](https://app.tomba.io/settings/webhooks)             |
| 邀请团队成员                            | [Members](https://app.tomba.io/settings/members)               |
| 查看可以访问您账户的 OAuth 应用 | [Connected apps](https://app.tomba.io/settings/connected-apps) |
| 报告错误数据                          | [Flags](https://app.tomba.io/settings/flags)                   |

在发送大量请求之前，请阅读[速率限制](/rate-limits)、[积分和用量](/usage-and-quotas)和[上线生产环境](/going-to-production)。
