Skip to content

Milestone API Reference

Endpoints

Get Milestone

Synchronous API Call

kalshi_py.api.milestone.get_milestone.sync(milestone_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetMilestoneResponse]

Get Milestone

Endpoint for getting data about a specific milestone by its ID.

Parameters:

Name Type Description Default
milestone_id str

Milestone 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[ModelGetMilestoneResponse]

ModelGetMilestoneResponse

Source code in kalshi_py/api/milestone/get_milestone.py
def sync(
    milestone_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetMilestoneResponse]:
    """Get Milestone

      Endpoint for getting data about a specific milestone by its ID.

    Args:
        milestone_id (str): Milestone 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:
        ModelGetMilestoneResponse
    """

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

Asynchronous API Call

kalshi_py.api.milestone.get_milestone.asyncio(milestone_id: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetMilestoneResponse] async

Get Milestone

Endpoint for getting data about a specific milestone by its ID.

Parameters:

Name Type Description Default
milestone_id str

Milestone 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[ModelGetMilestoneResponse]

ModelGetMilestoneResponse

Source code in kalshi_py/api/milestone/get_milestone.py
async def asyncio(
    milestone_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetMilestoneResponse]:
    """Get Milestone

      Endpoint for getting data about a specific milestone by its ID.

    Args:
        milestone_id (str): Milestone 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:
        ModelGetMilestoneResponse
    """

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

Synchronous Detailed Response

kalshi_py.api.milestone.get_milestone.sync_detailed(milestone_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetMilestoneResponse]

Get Milestone

Endpoint for getting data about a specific milestone by its ID.

Parameters:

Name Type Description Default
milestone_id str

Milestone 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[ModelGetMilestoneResponse]

Response[ModelGetMilestoneResponse]

Source code in kalshi_py/api/milestone/get_milestone.py
def sync_detailed(
    milestone_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetMilestoneResponse]:
    """Get Milestone

      Endpoint for getting data about a specific milestone by its ID.

    Args:
        milestone_id (str): Milestone 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[ModelGetMilestoneResponse]
    """

    kwargs = _get_kwargs(
        milestone_id=milestone_id,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.milestone.get_milestone.asyncio_detailed(milestone_id: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetMilestoneResponse] async

Get Milestone

Endpoint for getting data about a specific milestone by its ID.

Parameters:

Name Type Description Default
milestone_id str

Milestone 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[ModelGetMilestoneResponse]

Response[ModelGetMilestoneResponse]

Source code in kalshi_py/api/milestone/get_milestone.py
async def asyncio_detailed(
    milestone_id: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetMilestoneResponse]:
    """Get Milestone

      Endpoint for getting data about a specific milestone by its ID.

    Args:
        milestone_id (str): Milestone 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[ModelGetMilestoneResponse]
    """

    kwargs = _get_kwargs(
        milestone_id=milestone_id,
    )

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

    return _build_response(client=client, response=response)

Get Milestones

Synchronous API Call

kalshi_py.api.milestone.get_milestones.sync(*, client: Union[AuthenticatedClient, Client], minimum_start_date: Union[Unset, str] = UNSET, category: Union[Unset, str] = UNSET, competition: Union[Unset, str] = UNSET, type_: Union[Unset, str] = UNSET, related_event_ticker: Union[Unset, str] = UNSET, limit: int, cursor: Union[Unset, str] = UNSET) -> Optional[ModelGetMilestonesResponse]

Get Milestones

Endpoint for getting data about milestones with optional filtering.

Parameters:

Name Type Description Default
minimum_start_date Union[Unset, str]

Minimum start date to filter milestones. Format: RFC3339 timestamp

UNSET
category Union[Unset, str]

Filter by milestone category

UNSET
competition Union[Unset, str]

Filter by competition

UNSET
type_ Union[Unset, str]

Filter by milestone type

UNSET
related_event_ticker Union[Unset, str]

Filter by related event ticker

UNSET
limit int

Number of milestones to return per page

required
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results

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[ModelGetMilestonesResponse]

ModelGetMilestonesResponse

Source code in kalshi_py/api/milestone/get_milestones.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
    minimum_start_date: Union[Unset, str] = UNSET,
    category: Union[Unset, str] = UNSET,
    competition: Union[Unset, str] = UNSET,
    type_: Union[Unset, str] = UNSET,
    related_event_ticker: Union[Unset, str] = UNSET,
    limit: int,
    cursor: Union[Unset, str] = UNSET,
) -> Optional[ModelGetMilestonesResponse]:
    """Get Milestones

      Endpoint for getting data about milestones with optional filtering.

    Args:
        minimum_start_date (Union[Unset, str]): Minimum start date to filter milestones. Format:
            RFC3339 timestamp
        category (Union[Unset, str]): Filter by milestone category
        competition (Union[Unset, str]): Filter by competition
        type_ (Union[Unset, str]): Filter by milestone type
        related_event_ticker (Union[Unset, str]): Filter by related event ticker
        limit (int): Number of milestones to return per page
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results

    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:
        ModelGetMilestonesResponse
    """

    return sync_detailed(
        client=client,
        minimum_start_date=minimum_start_date,
        category=category,
        competition=competition,
        type_=type_,
        related_event_ticker=related_event_ticker,
        limit=limit,
        cursor=cursor,
    ).parsed

Asynchronous API Call

kalshi_py.api.milestone.get_milestones.asyncio(*, client: Union[AuthenticatedClient, Client], minimum_start_date: Union[Unset, str] = UNSET, category: Union[Unset, str] = UNSET, competition: Union[Unset, str] = UNSET, type_: Union[Unset, str] = UNSET, related_event_ticker: Union[Unset, str] = UNSET, limit: int, cursor: Union[Unset, str] = UNSET) -> Optional[ModelGetMilestonesResponse] async

Get Milestones

Endpoint for getting data about milestones with optional filtering.

Parameters:

Name Type Description Default
minimum_start_date Union[Unset, str]

Minimum start date to filter milestones. Format: RFC3339 timestamp

UNSET
category Union[Unset, str]

Filter by milestone category

UNSET
competition Union[Unset, str]

Filter by competition

UNSET
type_ Union[Unset, str]

Filter by milestone type

UNSET
related_event_ticker Union[Unset, str]

Filter by related event ticker

UNSET
limit int

Number of milestones to return per page

required
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results

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[ModelGetMilestonesResponse]

ModelGetMilestonesResponse

Source code in kalshi_py/api/milestone/get_milestones.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
    minimum_start_date: Union[Unset, str] = UNSET,
    category: Union[Unset, str] = UNSET,
    competition: Union[Unset, str] = UNSET,
    type_: Union[Unset, str] = UNSET,
    related_event_ticker: Union[Unset, str] = UNSET,
    limit: int,
    cursor: Union[Unset, str] = UNSET,
) -> Optional[ModelGetMilestonesResponse]:
    """Get Milestones

      Endpoint for getting data about milestones with optional filtering.

    Args:
        minimum_start_date (Union[Unset, str]): Minimum start date to filter milestones. Format:
            RFC3339 timestamp
        category (Union[Unset, str]): Filter by milestone category
        competition (Union[Unset, str]): Filter by competition
        type_ (Union[Unset, str]): Filter by milestone type
        related_event_ticker (Union[Unset, str]): Filter by related event ticker
        limit (int): Number of milestones to return per page
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results

    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:
        ModelGetMilestonesResponse
    """

    return (
        await asyncio_detailed(
            client=client,
            minimum_start_date=minimum_start_date,
            category=category,
            competition=competition,
            type_=type_,
            related_event_ticker=related_event_ticker,
            limit=limit,
            cursor=cursor,
        )
    ).parsed

Synchronous Detailed Response

kalshi_py.api.milestone.get_milestones.sync_detailed(*, client: Union[AuthenticatedClient, Client], minimum_start_date: Union[Unset, str] = UNSET, category: Union[Unset, str] = UNSET, competition: Union[Unset, str] = UNSET, type_: Union[Unset, str] = UNSET, related_event_ticker: Union[Unset, str] = UNSET, limit: int, cursor: Union[Unset, str] = UNSET) -> Response[ModelGetMilestonesResponse]

Get Milestones

Endpoint for getting data about milestones with optional filtering.

Parameters:

Name Type Description Default
minimum_start_date Union[Unset, str]

Minimum start date to filter milestones. Format: RFC3339 timestamp

UNSET
category Union[Unset, str]

Filter by milestone category

UNSET
competition Union[Unset, str]

Filter by competition

UNSET
type_ Union[Unset, str]

Filter by milestone type

UNSET
related_event_ticker Union[Unset, str]

Filter by related event ticker

UNSET
limit int

Number of milestones to return per page

required
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results

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[ModelGetMilestonesResponse]

Response[ModelGetMilestonesResponse]

Source code in kalshi_py/api/milestone/get_milestones.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    minimum_start_date: Union[Unset, str] = UNSET,
    category: Union[Unset, str] = UNSET,
    competition: Union[Unset, str] = UNSET,
    type_: Union[Unset, str] = UNSET,
    related_event_ticker: Union[Unset, str] = UNSET,
    limit: int,
    cursor: Union[Unset, str] = UNSET,
) -> Response[ModelGetMilestonesResponse]:
    """Get Milestones

      Endpoint for getting data about milestones with optional filtering.

    Args:
        minimum_start_date (Union[Unset, str]): Minimum start date to filter milestones. Format:
            RFC3339 timestamp
        category (Union[Unset, str]): Filter by milestone category
        competition (Union[Unset, str]): Filter by competition
        type_ (Union[Unset, str]): Filter by milestone type
        related_event_ticker (Union[Unset, str]): Filter by related event ticker
        limit (int): Number of milestones to return per page
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results

    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[ModelGetMilestonesResponse]
    """

    kwargs = _get_kwargs(
        minimum_start_date=minimum_start_date,
        category=category,
        competition=competition,
        type_=type_,
        related_event_ticker=related_event_ticker,
        limit=limit,
        cursor=cursor,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.milestone.get_milestones.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], minimum_start_date: Union[Unset, str] = UNSET, category: Union[Unset, str] = UNSET, competition: Union[Unset, str] = UNSET, type_: Union[Unset, str] = UNSET, related_event_ticker: Union[Unset, str] = UNSET, limit: int, cursor: Union[Unset, str] = UNSET) -> Response[ModelGetMilestonesResponse] async

Get Milestones

Endpoint for getting data about milestones with optional filtering.

Parameters:

Name Type Description Default
minimum_start_date Union[Unset, str]

Minimum start date to filter milestones. Format: RFC3339 timestamp

UNSET
category Union[Unset, str]

Filter by milestone category

UNSET
competition Union[Unset, str]

Filter by competition

UNSET
type_ Union[Unset, str]

Filter by milestone type

UNSET
related_event_ticker Union[Unset, str]

Filter by related event ticker

UNSET
limit int

Number of milestones to return per page

required
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results

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[ModelGetMilestonesResponse]

Response[ModelGetMilestonesResponse]

Source code in kalshi_py/api/milestone/get_milestones.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    minimum_start_date: Union[Unset, str] = UNSET,
    category: Union[Unset, str] = UNSET,
    competition: Union[Unset, str] = UNSET,
    type_: Union[Unset, str] = UNSET,
    related_event_ticker: Union[Unset, str] = UNSET,
    limit: int,
    cursor: Union[Unset, str] = UNSET,
) -> Response[ModelGetMilestonesResponse]:
    """Get Milestones

      Endpoint for getting data about milestones with optional filtering.

    Args:
        minimum_start_date (Union[Unset, str]): Minimum start date to filter milestones. Format:
            RFC3339 timestamp
        category (Union[Unset, str]): Filter by milestone category
        competition (Union[Unset, str]): Filter by competition
        type_ (Union[Unset, str]): Filter by milestone type
        related_event_ticker (Union[Unset, str]): Filter by related event ticker
        limit (int): Number of milestones to return per page
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results

    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[ModelGetMilestonesResponse]
    """

    kwargs = _get_kwargs(
        minimum_start_date=minimum_start_date,
        category=category,
        competition=competition,
        type_=type_,
        related_event_ticker=related_event_ticker,
        limit=limit,
        cursor=cursor,
    )

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

    return _build_response(client=client, response=response)