---
sidebar_position: 1
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Get Started
Make your first post to the Bluesky app via the API in under 5 minutes.
## Install the SDK
Choose the SDK you want to work with. Below, we use TypeScript and Python. You can follow the instructions for the community-maintained [atproto.dart package here](https://atprotodart.com/docs/intro).
Install [@atproto/api](https://www.npmjs.com/package/@atproto/api) using your preferred package manager.
```
yarn add @atproto/api
```
Install CURL if you need to. It comes pre-installed on most operating systems.
Install [atproto](https://pypi.org/project/atproto/) using your preferred package manager.
```
pip install atproto
```
## Create a session
Create an authentication session with your username and password.
```typescript
import { BskyAgent } from '@atproto/api'
const agent = new BskyAgent({
service: 'https://bsky.social'
})
await agent.login({
identifier: 'handle.example.com',
password: 'hunter2'
})
```
Replace `$BLUESKY_HANDLE` and `$BLUESKY_PASSWORD` with your credentials, and `$PDSHOST` with your PDS host (including `https://`).
```bash
curl -X POST $PDSHOST/xrpc/com.atproto.server.createSession \
-H "Content-Type: application/json" \
-d '{"identifier": "'"$BLUESKY_HANDLE"'", "password": "'"$BLUESKY_PASSWORD"'"}'
```
```python
from atproto import Client
client = Client()
client.login('handle.example.com', 'hunter2')
```
The `com.atproto.server.createSession` API endpoint returns a session object containing two API tokens:
* `accessJwt`: an access token which is used to authenticate requests but expires after a few minutes
* `refreshJwt`: a refresh token which lasts longer and is used only to update the session with a new access token
The agent object stores this session information for you, and will include it in the headers of its requests.
The client instance stores and manages this session information for you, and will include it in the headers of its requests.
## Create a post
Now you can create a post by sending a POST request to the createRecord endpoint.
```typescript
await agent.post({
text: 'Hello world! I posted this via the API.',
createdAt: new Date().toISOString()
})
```
Replace `$BLUESKY_HANDLE` with your handle, `$PDSHOST` with your PDS host (including `https://`), and and `$ACCESS_JWT` with the JWT in the response from createSession.
```bash
curl -X POST $PDSHOST/xrpc/com.atproto.repo.createRecord \
-H "Authorization: Bearer $ACCESS_JWT" \
-H "Content-Type: application/json" \
-d "{\"repo\": \"$BLUESKY_HANDLE\", \"collection\": \"app.bsky.feed.post\", \"record\": {\"text\": \"Hello world! I posted this via the API.\", \"createdAt\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}}"
```
```python
post = client.send_post('Hello world! I posted this via the Python SDK.')
```
This will return an object containing the post's URI and a CID (a hash of the content).
```json
{
"uri": "at://did:plc:abc123..../app.bsky.feed.post/xyz...",
"cid": "abc..."
}
```
```json
{
"uri": "at://did:plc:abc123..../app.bsky.feed.post/xyz...",
"cid": "abc..."
}
```
```python
post.uri # at://did:plc:abc123..../app.bsky.feed.post/xyz...
post.cid # abc...
```
Check out your profile to see the post you just created!
## Next Steps
- Jump to one of the [Starter Templates](/docs/category/starter-templates):
- [Bots](/docs/starter-templates/bots)
- [Custom Feeds](/docs/starter-templates/custom-feeds)
- [Clients](/docs/starter-templates/clients)
- Continue reading [Tutorials](/docs/category/tutorials) to learn more.