> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 빠른 시작

> 이 예제는 Bearer Token 인증을 사용하여 XDK로 Posts를 빠르게 검색하는 방법을 보여줍니다. 1. X Developer Console에 로그인합니다. 2.

이 예제는 Bearer Token 인증을 사용하여 XDK로 Posts를 빠르게 검색하는 방법을 보여줍니다.

## 1단계: SDK 설치

```bash theme={null}
pip install xdk
```

## 2단계: Bearer Token 가져오기

1. [X Developer Console](https://developer.x.com/en/portal/dashboard)에 로그인합니다.
2. 앱을 생성하거나 선택합니다.
3. "Keys and Tokens"에서 Bearer Token(앱 전용 인증)을 생성합니다.

## 3단계: 첫 번째 스크립트 작성 및 실행

`quickstart.py` 파일을 생성합니다:

```python title="Example" lines wrap icon="python" theme={null}
# Import the client
from xdk import Client
# Replace with your actual Bearer Token
client = Client(bearer_token="YOUR_BEARER_TOKEN_HERE")
# Fetch recent Posts mentioning "api"
# search_recent returns an Iterator, so iterate over it
for page in client.posts.search_recent(query="api", max_results=10):
    if page.data and len(page.data) > 0:
        # Access first Post - Pydantic models support both attribute and dict access
        first_post = page.data[0]
        post_text = first_post.text if hasattr(first_post, 'text') else first_post.get('text', '')
        print(f"Latest Post: {post_text}")
        break
    else:
        print("No Posts found.")
        break
```

실행:

```bash theme={null}
python quickstart.py
```

**예상 출력**:

```
Latest Post: Exciting updates on XDK Python SDK!
```

**문제 해결**: 401 오류가 발생하면 Bearer Token을 다시 확인하세요. 속도 제한(429)의 경우 잠시 후 재시도하세요.

## 다음 단계

* Bearer Token(앱 전용) 인증, PKCE를 사용한 OAuth 2.0(사용자 컨텍스트), OAuth 1.0a(레거시 사용자 컨텍스트)를 사용하는 방법을 이해하려면 [인증](/xdks/python/authentication)을 살펴보세요.
* 여러 API 호출을 걱정하지 않고 많은 수의 결과를 반환하려는 사용 사례를 위해 [페이지네이션](/xdks/python/pagination)에 대해 알아보세요.
* 실시간 데이터 작업 방법을 배우려면 [스트리밍](/xdks/python/streaming)을 살펴보세요.
  Python XDK를 사용하는 자세한 코드 예제는 [코드 샘플 GitHub 저장소](https://github.com/xdevplatform/samples/tree/main/python)를 확인하세요.
