Documentation Index
Fetch the complete documentation index at: https://generaltranslation.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
이 가이드는 지난 7일간의 게시물 수(볼륨)를 조회하는 방법을 안내합니다.
사전 준비 사항시작하기 전에 다음이 필요합니다.
- 승인이 완료된 App이 있는 개발자 계정
- App의 Bearer 토큰
쿼리 작성
최근 검색과 동일한 쿼리 구문을 사용합니다. 예를 들어 @XDevelopers 계정의 포스트 개수를 집계하려면 다음 쿼리를 사용할 수 있습니다: 요청 보내기
curl "https://api.x.com/2/tweets/counts/recent?\
query=from%3AXDevelopers&\
granularity=day" \
-H "Authorization: Bearer $BEARER_TOKEN"
응답 검토
{
"data": [
{
"end": "2024-01-16T00:00:00.000Z",
"start": "2024-01-15T00:00:00.000Z",
"tweet_count": 5
},
{
"end": "2024-01-17T00:00:00.000Z",
"start": "2024-01-16T00:00:00.000Z",
"tweet_count": 3
},
{
"end": "2024-01-18T00:00:00.000Z",
"start": "2024-01-17T00:00:00.000Z",
"tweet_count": 8
}
],
"meta": {
"total_tweet_count": 16
}
}
집계 단위를 제어합니다:
| Granularity | 설명 |
|---|
minute | 분 단위 집계 |
hour | 시간 단위 집계(기본값) |
day | 일 단위 집계 |
# 시간 단위 집계 가져오기
curl "https://api.x.com/2/tweets/counts/recent?\
query=python%20lang%3Aen&\
granularity=hour" \
-H "Authorization: Bearer $BEARER_TOKEN"
집계를 특정 기간으로 제한하려면:
curl "https://api.x.com/2/tweets/counts/recent?\
query=from%3AXDevelopers&\
start_time=2024-01-10T00%3A00%3A00Z&\
end_time=2024-01-15T00%3A00%3A00Z&\
granularity=day" \
-H "Authorization: Bearer $BEARER_TOKEN"
| Parameter | Description | Default |
|---|
query | 검색 쿼리 (필수) | — |
granularity | 시간 구간 단위(버킷 크기) | hour |
start_time | 가장 오래된 타임스탬프 (ISO 8601) | 7일 전 |
end_time | 가장 최신 타임스탬프 (ISO 8601) | 현재 |