Skip to content

Structured_Target API Reference

Endpoints

Get Structured Target

Synchronous API Call

kalshi_py.api.structured_target.get_structured_target.sync(structured_target_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetStructuredTargetResponse]

Get Structured Target

Endpoint for getting data about a specific structured target by its ID.

Parameters:

Name Type Description Default
structured_target_id str

Structured Target ID

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelGetStructuredTargetResponse]

ModelGetStructuredTargetResponse

Source code in kalshi_py/api/structured_target/get_structured_target.py
def sync(
    structured_target_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetStructuredTargetResponse]:
    """Get Structured Target

      Endpoint for getting data about a specific structured target by its ID.

    Args:
        structured_target_id (str): Structured Target ID

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelGetStructuredTargetResponse
    """

    return sync_detailed(
        structured_target_id=structured_target_id,
        client=client,
    ).parsed

Asynchronous API Call

kalshi_py.api.structured_target.get_structured_target.asyncio(structured_target_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetStructuredTargetResponse] async

Get Structured Target

Endpoint for getting data about a specific structured target by its ID.

Parameters:

Name Type Description Default
structured_target_id str

Structured Target ID

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelGetStructuredTargetResponse]

ModelGetStructuredTargetResponse

Source code in kalshi_py/api/structured_target/get_structured_target.py
async def asyncio(
    structured_target_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetStructuredTargetResponse]:
    """Get Structured Target

      Endpoint for getting data about a specific structured target by its ID.

    Args:
        structured_target_id (str): Structured Target ID

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelGetStructuredTargetResponse
    """

    return (
        await asyncio_detailed(
            structured_target_id=structured_target_id,
            client=client,
        )
    ).parsed

Synchronous Detailed Response

kalshi_py.api.structured_target.get_structured_target.sync_detailed(structured_target_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetStructuredTargetResponse]

Get Structured Target

Endpoint for getting data about a specific structured target by its ID.

Parameters:

Name Type Description Default
structured_target_id str

Structured Target ID

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelGetStructuredTargetResponse]

Response[ModelGetStructuredTargetResponse]

Source code in kalshi_py/api/structured_target/get_structured_target.py
def sync_detailed(
    structured_target_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetStructuredTargetResponse]:
    """Get Structured Target

      Endpoint for getting data about a specific structured target by its ID.

    Args:
        structured_target_id (str): Structured Target ID

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelGetStructuredTargetResponse]
    """

    kwargs = _get_kwargs(
        structured_target_id=structured_target_id,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.structured_target.get_structured_target.asyncio_detailed(structured_target_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetStructuredTargetResponse] async

Get Structured Target

Endpoint for getting data about a specific structured target by its ID.

Parameters:

Name Type Description Default
structured_target_id str

Structured Target ID

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelGetStructuredTargetResponse]

Response[ModelGetStructuredTargetResponse]

Source code in kalshi_py/api/structured_target/get_structured_target.py
async def asyncio_detailed(
    structured_target_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetStructuredTargetResponse]:
    """Get Structured Target

      Endpoint for getting data about a specific structured target by its ID.

    Args:
        structured_target_id (str): Structured Target ID

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelGetStructuredTargetResponse]
    """

    kwargs = _get_kwargs(
        structured_target_id=structured_target_id,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

Get Structured Targets

Synchronous API Call

kalshi_py.api.structured_target.get_structured_targets.sync(*, client: Union[AuthenticatedClient, Client], type_: Union[Unset, str] = UNSET, competition: Union[Unset, str] = UNSET, page_size: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET) -> Optional[ModelGetStructuredTargetsResponse]

Get Structured Targets

Endpoint for getting data about structured targets.

Parameters:

Name Type Description Default
type_ Union[Unset, str]

Type of structured target

UNSET
competition Union[Unset, str]

Competition filter

UNSET
page_size Union[Unset, int]

Page size (min: 1, max: 2000)

UNSET
cursor Union[Unset, str]

Pagination cursor

UNSET

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelGetStructuredTargetsResponse]

ModelGetStructuredTargetsResponse

Source code in kalshi_py/api/structured_target/get_structured_targets.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
    type_: Union[Unset, str] = UNSET,
    competition: Union[Unset, str] = UNSET,
    page_size: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
) -> Optional[ModelGetStructuredTargetsResponse]:
    """Get Structured Targets

      Endpoint for getting data about structured targets.

    Args:
        type_ (Union[Unset, str]): Type of structured target
        competition (Union[Unset, str]): Competition filter
        page_size (Union[Unset, int]): Page size (min: 1, max: 2000)
        cursor (Union[Unset, str]): Pagination cursor

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelGetStructuredTargetsResponse
    """

    return sync_detailed(
        client=client,
        type_=type_,
        competition=competition,
        page_size=page_size,
        cursor=cursor,
    ).parsed

Asynchronous API Call

kalshi_py.api.structured_target.get_structured_targets.asyncio(*, client: Union[AuthenticatedClient, Client], type_: Union[Unset, str] = UNSET, competition: Union[Unset, str] = UNSET, page_size: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET) -> Optional[ModelGetStructuredTargetsResponse] async

Get Structured Targets

Endpoint for getting data about structured targets.

Parameters:

Name Type Description Default
type_ Union[Unset, str]

Type of structured target

UNSET
competition Union[Unset, str]

Competition filter

UNSET
page_size Union[Unset, int]

Page size (min: 1, max: 2000)

UNSET
cursor Union[Unset, str]

Pagination cursor

UNSET

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelGetStructuredTargetsResponse]

ModelGetStructuredTargetsResponse

Source code in kalshi_py/api/structured_target/get_structured_targets.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
    type_: Union[Unset, str] = UNSET,
    competition: Union[Unset, str] = UNSET,
    page_size: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
) -> Optional[ModelGetStructuredTargetsResponse]:
    """Get Structured Targets

      Endpoint for getting data about structured targets.

    Args:
        type_ (Union[Unset, str]): Type of structured target
        competition (Union[Unset, str]): Competition filter
        page_size (Union[Unset, int]): Page size (min: 1, max: 2000)
        cursor (Union[Unset, str]): Pagination cursor

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelGetStructuredTargetsResponse
    """

    return (
        await asyncio_detailed(
            client=client,
            type_=type_,
            competition=competition,
            page_size=page_size,
            cursor=cursor,
        )
    ).parsed

Synchronous Detailed Response

kalshi_py.api.structured_target.get_structured_targets.sync_detailed(*, client: Union[AuthenticatedClient, Client], type_: Union[Unset, str] = UNSET, competition: Union[Unset, str] = UNSET, page_size: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET) -> Response[ModelGetStructuredTargetsResponse]

Get Structured Targets

Endpoint for getting data about structured targets.

Parameters:

Name Type Description Default
type_ Union[Unset, str]

Type of structured target

UNSET
competition Union[Unset, str]

Competition filter

UNSET
page_size Union[Unset, int]

Page size (min: 1, max: 2000)

UNSET
cursor Union[Unset, str]

Pagination cursor

UNSET

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelGetStructuredTargetsResponse]

Response[ModelGetStructuredTargetsResponse]

Source code in kalshi_py/api/structured_target/get_structured_targets.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    type_: Union[Unset, str] = UNSET,
    competition: Union[Unset, str] = UNSET,
    page_size: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
) -> Response[ModelGetStructuredTargetsResponse]:
    """Get Structured Targets

      Endpoint for getting data about structured targets.

    Args:
        type_ (Union[Unset, str]): Type of structured target
        competition (Union[Unset, str]): Competition filter
        page_size (Union[Unset, int]): Page size (min: 1, max: 2000)
        cursor (Union[Unset, str]): Pagination cursor

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelGetStructuredTargetsResponse]
    """

    kwargs = _get_kwargs(
        type_=type_,
        competition=competition,
        page_size=page_size,
        cursor=cursor,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.structured_target.get_structured_targets.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], type_: Union[Unset, str] = UNSET, competition: Union[Unset, str] = UNSET, page_size: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET) -> Response[ModelGetStructuredTargetsResponse] async

Get Structured Targets

Endpoint for getting data about structured targets.

Parameters:

Name Type Description Default
type_ Union[Unset, str]

Type of structured target

UNSET
competition Union[Unset, str]

Competition filter

UNSET
page_size Union[Unset, int]

Page size (min: 1, max: 2000)

UNSET
cursor Union[Unset, str]

Pagination cursor

UNSET

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelGetStructuredTargetsResponse]

Response[ModelGetStructuredTargetsResponse]

Source code in kalshi_py/api/structured_target/get_structured_targets.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    type_: Union[Unset, str] = UNSET,
    competition: Union[Unset, str] = UNSET,
    page_size: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
) -> Response[ModelGetStructuredTargetsResponse]:
    """Get Structured Targets

      Endpoint for getting data about structured targets.

    Args:
        type_ (Union[Unset, str]): Type of structured target
        competition (Union[Unset, str]): Competition filter
        page_size (Union[Unset, int]): Page size (min: 1, max: 2000)
        cursor (Union[Unset, str]): Pagination cursor

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelGetStructuredTargetsResponse]
    """

    kwargs = _get_kwargs(
        type_=type_,
        competition=competition,
        page_size=page_size,
        cursor=cursor,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)