> ## 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.

# Reposts of Me

> Este guia mostra como recuperar seus Posts que foram Retweetados por outros. Referência para o tier standard da X API v2 sobre quickstart.

export const Button = ({href, children}) => {
  return <div className="not-prose">
    <a href={href}>
      <button className="x-btn">
        <span>{children}</span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

Este guia mostra como recuperar seus Posts que foram Retweetados por outros.

<Note>
  **Pré-requisitos**

  Antes de começar, você precisará de:

  * Uma [conta de desenvolvedor](https://developer.x.com/en/portal/petition/essential/basic-info) com um App aprovado
  * User Access Token (OAuth 1.0a ou OAuth 2.0 PKCE)
</Note>

***

## Por que usar Reposts of Me?

O endpoint Reposts of Me ajuda você a:

* **Acompanhar engajamento** — Veja quais dos seus Posts estão sendo compartilhados
* **Entender o alcance** — Aprenda qual conteúdo ressoa com o seu público
* **Informar a estratégia** — Ajuste sua estratégia de conteúdo com base nos padrões de compartilhamento

***

## Obtenha seus Posts Retweetados

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl "https://api.x.com/2/users/reposts_of_me?\
  tweet.fields=created_at,public_metrics&\
  max_results=10" \
    -H "Authorization: Bearer $USER_ACCESS_TOKEN"
  ```

  ```python Python SDK theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_USER_ACCESS_TOKEN")

  # Obter seus Posts que foram Retweetados
  for page in client.posts.get_reposts_of_me(
      tweet_fields=["created_at", "public_metrics"],
      max_results=10
  ):
      for post in page.data:
          print(f"{post.text[:50]}... - Retweets: {post.public_metrics.retweet_count}")
  ```

  ```javascript title="JavaScript SDK" lines wrap icon="square-js" theme={null}
  import { Client } from "@xdevplatform/xdk";

  const client = new Client({ accessToken: "YOUR_USER_ACCESS_TOKEN" });

  // Obter seus Posts que foram Retweetados
  const paginator = client.posts.getRepostsOfMe({
    tweetFields: ["created_at", "public_metrics"],
    maxResults: 10,
  });

  for await (const page of paginator) {
    page.data?.forEach((post) => {
      console.log(`${post.text?.slice(0, 50)}... - Retweets: ${post.public_metrics?.retweet_count}`);
    });
  }
  ```
</CodeGroup>

***

## Resposta

```json title="Exemplo de resposta" expandable lines wrap icon="https://mintcdn.com/x-preview/Vn2KEkZaPF9LiPi3/icons/xds/icon-brackets.svg?fit=max&auto=format&n=Vn2KEkZaPF9LiPi3&q=85&s=ed2428e77bab43e57800e1a590e982fa" theme={null}
{
  "data": [
    {
      "id": "1848781937210802364",
      "text": "ever wanted to discover trends.. before they're trends?...",
      "created_at": "2024-01-15T10:30:00.000Z",
      "public_metrics": {
        "retweet_count": 42,
        "reply_count": 5,
        "like_count": 156,
        "quote_count": 8
      },
      "edit_history_tweet_ids": ["1848781937210802364"]
    },
    {
      "id": "1847990559081648620",
      "text": "posting is just journaling with an audience",
      "created_at": "2024-01-14T15:20:00.000Z",
      "public_metrics": {
        "retweet_count": 28,
        "reply_count": 12,
        "like_count": 89,
        "quote_count": 3
      },
      "edit_history_tweet_ids": ["1847990559081648620"]
    }
  ],
  "meta": {
    "result_count": 2,
    "next_token": "7140dibdnow9c7btw481s8m561gat797rboud5r80xvzm"
  }
}
```

***

## Filtre por intervalo de tempo

Obtenha Posts Retweetados de um período específico:

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl "https://api.x.com/2/users/reposts_of_me?\
  start_time=2024-01-01T00%3A00%3A00Z&\
  end_time=2024-01-31T23%3A59%3A59Z&\
  tweet.fields=created_at,public_metrics" \
    -H "Authorization: Bearer $USER_ACCESS_TOKEN"
  ```

  ```python title="Python SDK" lines wrap icon="python" theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_USER_ACCESS_TOKEN")

  # Obter Posts Retweetados de um intervalo de tempo
  for page in client.posts.get_reposts_of_me(
      start_time="2024-01-01T00:00:00Z",
      end_time="2024-01-31T23:59:59Z",
      tweet_fields=["created_at", "public_metrics"]
  ):
      for post in page.data:
          print(f"{post.created_at}: {post.text[:50]}...")
  ```

  ```javascript title="JavaScript SDK" lines wrap icon="square-js" theme={null}
  import { Client } from "@xdevplatform/xdk";

  const client = new Client({ accessToken: "YOUR_USER_ACCESS_TOKEN" });

  // Obter Posts Retweetados de um intervalo de tempo
  const paginator = client.posts.getRepostsOfMe({
    startTime: "2024-01-01T00:00:00Z",
    endTime: "2024-01-31T23:59:59Z",
    tweetFields: ["created_at", "public_metrics"],
  });

  for await (const page of paginator) {
    page.data?.forEach((post) => {
      console.log(`${post.created_at}: ${post.text?.slice(0, 50)}...`);
    });
  }
  ```
</CodeGroup>

***

## Parâmetros comuns

| Parâmetro          | Descrição                                 | Padrão       |
| :----------------- | :---------------------------------------- | :----------- |
| `max_results`      | Resultados por página (1-100)             | 10           |
| `start_time`       | Timestamp do Post mais antigo (ISO 8601)  | —            |
| `end_time`         | Timestamp do Post mais recente (ISO 8601) | —            |
| `pagination_token` | Token para a próxima página               | —            |
| `tweet.fields`     | Fields adicionais de Post                 | `id`, `text` |

***

## Próximos passos

<CardGroup cols={2}>
  <Card title="Consulta de Retweets" icon="retweet" href="/x-api/posts/retweets/quickstart/retweets-lookup">
    Veja quem Retweetou um Post
  </Card>

  <Card title="Gerenciar Retweets" icon="share" href="/x-api/posts/retweets/quickstart/manage-retweets">
    Retweete e desfaça Retweets
  </Card>

  <Card title="Referência da API" icon="https://mintcdn.com/x-preview/ygI6sSJPehlc0qNT/icons/xds/icon-code.svg?fit=max&auto=format&n=ygI6sSJPehlc0qNT&q=85&s=488e23401b19225b89acc0136d242219" href="/x-api/users/get-reposts-of-me" width="24" height="24" data-path="icons/xds/icon-code.svg">
    Documentação completa do endpoint
  </Card>
</CardGroup>
