> For the complete documentation index, see [llms.txt](https://bohd4nx.gitbook.io/pyfragment/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bohd4nx.gitbook.io/pyfragment/overview.md).

# Overview

`pyfragment` is an async Python client for [Fragment](https://fragment.com).

If you are integrating Fragment into a bot or backend, this docs set is meant to be practical, not theoretical.

**Recommended reading order:**

1. Install the package
2. Configure `FragmentClient`
3. Set up credentials and cookies
4. Run the quick start
5. Move to feature-specific flows

## Who this is for

* Python developers integrating Fragment into bots, services, and automation.
* Teams that need predictable typed results and explicit error behavior.

**Important:** this library is not affiliated with Fragment or Telegram.

## Where to begin

1. [Installation](/pyfragment/setup-guide/installation.md)
2. [Library and Configuration](/pyfragment/setup-guide/configuration.md)
3. [Credentials and Cookies](/pyfragment/setup-guide/credentials-and-cookies.md)
4. [Quick Start](/pyfragment/setup-guide/quickstart.md)

## Feature entry points

* Stars: [Purchase](/pyfragment/api-guides/stars/purchase.md), [Giveaway](/pyfragment/api-guides/stars/giveaway.md)
* Premium: [Purchase](/pyfragment/api-guides/premium/purchase.md), [Giveaway](/pyfragment/api-guides/premium/giveaway.md)
* Marketplace: [Overview](/pyfragment/api-guides/marketplace/overview.md), Ads: [Overview](/pyfragment/api-guides/ads/overview.md)
* Numbers: [Anonymous Numbers](/pyfragment/api-guides/anonymous-numbers/overview.md)
* Utility operations: [Raw API Calls](/pyfragment/api-guides/raw-call.md)

## Additional references

* [Error Handling](/pyfragment/errors.md)
* [Result Models](/pyfragment/reference/models.md)
* [Literal Types](/pyfragment/reference/literals.md)
* [Troubleshooting](/pyfragment/advanced/troubleshooting.md)

## Live examples

**Up-to-date runnable examples live in the main repository:**

* <https://github.com/bohd4nx/pyfragment/tree/master/examples>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bohd4nx.gitbook.io/pyfragment/overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
