> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-mintlify-143107c1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# PostsClient

> Referencia del módulo Python posts.client en el SDK de la X API. Clase de cliente y métodos para llamar a los endpoints posts de la X API v2.

## PostsClient

<Badge color="blue">Class</Badge>

<Badge color="gray">Bases: object</Badge>

Cliente para operaciones de posts

## Constructores

### `__init__`

#### Parámetros

<ParamField path="path.client" type="Client" />

### `create`

Crear o editar Post
Crea un nuevo Post para el usuario autenticado, o edita un Post existente cuando se proporcionan edit\_options.
body: Cuerpo de la solicitud
:returns: Datos de respuesta
:rtype: CreateResponse

#### Parámetros

<ParamField path="body.body" type="CreateRequest" />

### `delete`

Eliminar Post
Elimina un Post específico por su ID, si es propiedad del usuario autenticado.

#### Parámetros

<ParamField path="path.id" type="Any">
  El ID del Post que se eliminará.
</ParamField>

#### Devuelve

`DeleteResponse` - Response data

### `get_analytics`

Obtener análisis del Post
Recupera datos de análisis para los Posts especificados dentro de un rango de tiempo definido.

#### Parámetros

<ParamField path="path.ids" type="List">
  Una lista separada por comas de IDs de Post. Se permiten hasta 100 en una sola solicitud.
</ParamField>

<ParamField path="path.end_time" type="str">
  YYYY-MM-DDTHH:mm:ssZ. La marca de tiempo UTC que representa el final del rango de tiempo.
</ParamField>

<ParamField path="path.start_time" type="str">
  YYYY-MM-DDTHH:mm:ssZ. La marca de tiempo UTC que representa el inicio del rango de tiempo.
</ParamField>

<ParamField path="path.granularity" type="str">
  La granularidad para los resultados de conteos de búsqueda.
</ParamField>

<ParamField path="path.analytics_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Analytics a mostrar.
</ParamField>

#### Devuelve

`GetAnalyticsResponse` - Response data

### `get_by_id`

Obtener Post por ID
Recupera los detalles de un Post específico por su ID.

#### Parámetros

<ParamField path="path.id" type="Any">
  Un único ID de Post.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Tweet a mostrar.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  Una lista separada por comas de campos para expandir.
</ParamField>

<ParamField path="path.media_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Media a mostrar.
</ParamField>

<ParamField path="path.poll_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Poll a mostrar.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  Una lista separada por comas de campos de User a mostrar.
</ParamField>

<ParamField path="path.place_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Place a mostrar.
</ParamField>

#### Devuelve

`GetByIdResponse` - Response data

### `get_by_ids`

Obtener Posts por IDs
Recupera los detalles de varios Posts por sus IDs.

#### Parámetros

<ParamField path="path.ids" type="List">
  Una lista separada por comas de IDs de Post. Se permiten hasta 100 en una sola solicitud.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Tweet a mostrar.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  Una lista separada por comas de campos para expandir.
</ParamField>

<ParamField path="path.media_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Media a mostrar.
</ParamField>

<ParamField path="path.poll_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Poll a mostrar.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  Una lista separada por comas de campos de User a mostrar.
</ParamField>

<ParamField path="path.place_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Place a mostrar.
</ParamField>

#### Devuelve

`GetByIdsResponse` - Response data

### `get_counts_all`

Get count of all Posts
Retrieves the count of Posts matching a search query from the full archive.

#### Parámetros

<ParamField path="path.query" type="str">
  One query/rule/filter for matching Posts. Refer to [https://t.co/rulelength](https://t.co/rulelength) to identify the max query length.
</ParamField>

<ParamField path="path.start_time" type="str or None" default="None">
  YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).
</ParamField>

<ParamField path="path.end_time" type="str or None" default="None">
  YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).
</ParamField>

<ParamField path="path.since_id" type="Any or None" default="None">
  Returns results with a Post ID greater than (that is, more recent than) the specified ID.
</ParamField>

<ParamField path="path.until_id" type="Any or None" default="None">
  Returns results with a Post ID less than (that is, older than) the specified ID.
</ParamField>

<ParamField path="path.next_token" type="Any or None" default="None">
  This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
</ParamField>

<ParamField path="path.granularity" type="str or None" default="None">
  La granularidad para los resultados de conteos de búsqueda.
</ParamField>

<ParamField path="path.search_count_fields" type="List or None" default="None">
  A comma separated list of SearchCount fields to display.
</ParamField>

#### Devuelve

`IteratorGetCountsAllResponse`

### `get_counts_recent`

Get count of recent Posts
Retrieves the count of Posts from the last 7 days matching a search query.

#### Parámetros

<ParamField path="path.query" type="str">
  One query/rule/filter for matching Posts. Refer to [https://t.co/rulelength](https://t.co/rulelength) to identify the max query length.
</ParamField>

<ParamField path="path.start_time" type="str or None" default="None">
  YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).
</ParamField>

<ParamField path="path.end_time" type="str or None" default="None">
  YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).
</ParamField>

<ParamField path="path.since_id" type="Any or None" default="None">
  Returns results with a Post ID greater than (that is, more recent than) the specified ID.
</ParamField>

<ParamField path="path.until_id" type="Any or None" default="None">
  Returns results with a Post ID less than (that is, older than) the specified ID.
</ParamField>

<ParamField path="path.next_token" type="Any or None" default="None">
  This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
</ParamField>

<ParamField path="path.granularity" type="str or None" default="None">
  La granularidad para los resultados de conteos de búsqueda.
</ParamField>

<ParamField path="path.search_count_fields" type="List or None" default="None">
  A comma separated list of SearchCount fields to display.
</ParamField>

#### Devuelve

`IteratorGetCountsRecentResponse`

### `get_insights28hr`

Get 28-hour Post insights
Retrieves engagement metrics for specified Posts over the last 28 hours.

#### Parámetros

<ParamField path="path.tweet_ids" type="List">
  List of PostIds for 28hr metrics.
</ParamField>

<ParamField path="path.granularity" type="str">
  granularity of metrics response.
</ParamField>

<ParamField path="path.requested_metrics" type="List">
  request metrics for historical request.
</ParamField>

<ParamField path="path.engagement_fields" type="List or None" default="None">
  A comma separated list of Engagement fields to display.
</ParamField>

#### Devuelve

`GetInsights28hrResponse` - Response data

### `get_insights_historical`

Get historical Post insights
Retrieves historical engagement metrics for specified Posts within a defined time range.

#### Parámetros

<ParamField path="path.tweet_ids" type="List">
  List of PostIds for historical metrics.
</ParamField>

<ParamField path="path.end_time" type="str">
  YYYY-MM-DDTHH:mm:ssZ. La marca de tiempo UTC que representa el final del rango de tiempo.
</ParamField>

<ParamField path="path.start_time" type="str">
  YYYY-MM-DDTHH:mm:ssZ. La marca de tiempo UTC que representa el inicio del rango de tiempo.
</ParamField>

<ParamField path="path.granularity" type="str">
  granularity of metrics response.
</ParamField>

<ParamField path="path.requested_metrics" type="List">
  request metrics for historical request.
</ParamField>

<ParamField path="path.engagement_fields" type="List or None" default="None">
  A comma separated list of Engagement fields to display.
</ParamField>

#### Devuelve

`GetInsightsHistoricalResponse` - Response data

### `get_liking_users`

Get Liking Users
Retrieves a list of Users who liked a specific Post by its ID.

#### Parámetros

<ParamField path="path.id" type="Any">
  Un único ID de Post.
</ParamField>

<ParamField path="path.max_results" type="int or None" default="None">
  El número máximo de resultados.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get the next ‘page’ of results.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  Una lista separada por comas de campos de User a mostrar.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  Una lista separada por comas de campos para expandir.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Tweet a mostrar.
</ParamField>

#### Devuelve

`IteratorGetLikingUsersResponse`

### `get_quoted`

Get Quoted Posts
Retrieves a list of Posts that quote a specific Post by its ID.

#### Parámetros

<ParamField path="path.id" type="Any">
  Un único ID de Post.
</ParamField>

<ParamField path="path.max_results" type="int or None" default="None">
  The maximum number of results to be returned.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get a specified ‘page’ of results.
</ParamField>

<ParamField path="path.exclude" type="List or None" default="None">
  The set of entities to exclude (e.g. ‘replies’ or ‘retweets’).
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Tweet a mostrar.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  Una lista separada por comas de campos para expandir.
</ParamField>

<ParamField path="path.media_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Media a mostrar.
</ParamField>

<ParamField path="path.poll_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Poll a mostrar.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  Una lista separada por comas de campos de User a mostrar.
</ParamField>

<ParamField path="path.place_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Place a mostrar.
</ParamField>

#### Devuelve

`IteratorGetQuotedResponse`

### `get_reposted_by`

Get Reposted by
Retrieves a list of Users who reposted a specific Post by its ID.

#### Parámetros

<ParamField path="path.id" type="Any">
  Un único ID de Post.
</ParamField>

<ParamField path="path.max_results" type="int or None" default="None">
  El número máximo de resultados.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get the next ‘page’ of results.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  Una lista separada por comas de campos de User a mostrar.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  Una lista separada por comas de campos para expandir.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Tweet a mostrar.
</ParamField>

#### Devuelve

`IteratorGetRepostedByResponse`

### `get_reposts`

Get Reposts
Retrieves a list of Posts that repost a specific Post by its ID.

#### Parámetros

<ParamField path="path.id" type="Any">
  Un único ID de Post.
</ParamField>

<ParamField path="path.max_results" type="int or None" default="None">
  El número máximo de resultados.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get the next ‘page’ of results.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Tweet a mostrar.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  Una lista separada por comas de campos para expandir.
</ParamField>

<ParamField path="path.media_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Media a mostrar.
</ParamField>

<ParamField path="path.poll_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Poll a mostrar.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  Una lista separada por comas de campos de User a mostrar.
</ParamField>

<ParamField path="path.place_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Place a mostrar.
</ParamField>

#### Devuelve

`IteratorGetRepostsResponse`

### `hide_reply`

Hide reply
Hides or unhides a reply to a conversation owned by the authenticated user.

#### Parámetros

<ParamField path="path.tweet_id" type="Any">
  The ID of the reply that you want to hide or unhide.
</ParamField>

<ParamField path="body.body" type="HideReplyRequest">
  Request body
</ParamField>

### `search_all`

Search all Posts
Retrieves Posts from the full archive matching a search query.

#### Parámetros

<ParamField path="path.query" type="str">
  One query/rule/filter for matching Posts. Refer to [https://t.co/rulelength](https://t.co/rulelength) to identify the max query length.
</ParamField>

<ParamField path="path.start_time" type="str or None" default="None">
  YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).
</ParamField>

<ParamField path="path.end_time" type="str or None" default="None">
  YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).
</ParamField>

<ParamField path="path.since_id" type="Any or None" default="None">
  Returns results with a Post ID greater than (that is, more recent than) the specified ID.
</ParamField>

<ParamField path="path.until_id" type="Any or None" default="None">
  Returns results with a Post ID less than (that is, older than) the specified ID.
</ParamField>

<ParamField path="path.max_results" type="int or None" default="None">
  The maximum number of search results to be returned by a request.
</ParamField>

<ParamField path="path.next_token" type="Any or None" default="None">
  This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
</ParamField>

<ParamField path="path.sort_order" type="str or None" default="None">
  This order in which to return results.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Tweet a mostrar.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  Una lista separada por comas de campos para expandir.
</ParamField>

<ParamField path="path.media_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Media a mostrar.
</ParamField>

<ParamField path="path.poll_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Poll a mostrar.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  Una lista separada por comas de campos de User a mostrar.
</ParamField>

<ParamField path="path.place_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Place a mostrar.
</ParamField>

#### Devuelve

`IteratorSearchAllResponse`

### `search_recent`

Search recent Posts
Retrieves Posts from the last 7 days matching a search query.

#### Parámetros

<ParamField path="path.query" type="str">
  One query/rule/filter for matching Posts. Refer to [https://t.co/rulelength](https://t.co/rulelength) to identify the max query length.
</ParamField>

<ParamField path="path.start_time" type="str or None" default="None">
  YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).
</ParamField>

<ParamField path="path.end_time" type="str or None" default="None">
  YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).
</ParamField>

<ParamField path="path.since_id" type="Any or None" default="None">
  Returns results with a Post ID greater than (that is, more recent than) the specified ID.
</ParamField>

<ParamField path="path.until_id" type="Any or None" default="None">
  Returns results with a Post ID less than (that is, older than) the specified ID.
</ParamField>

<ParamField path="path.max_results" type="int or None" default="None">
  The maximum number of search results to be returned by a request.
</ParamField>

<ParamField path="path.next_token" type="Any or None" default="None">
  This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
</ParamField>

<ParamField path="path.sort_order" type="str or None" default="None">
  This order in which to return results.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Tweet a mostrar.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  Una lista separada por comas de campos para expandir.
</ParamField>

<ParamField path="path.media_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Media a mostrar.
</ParamField>

<ParamField path="path.poll_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Poll a mostrar.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  Una lista separada por comas de campos de User a mostrar.
</ParamField>

<ParamField path="path.place_fields" type="List or None" default="None">
  Una lista separada por comas de campos de Place a mostrar.
</ParamField>

#### Devuelve

`IteratorSearchRecentResponse`
