> For the complete documentation index, see [llms.txt](https://www.csvpath.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.csvpath.org/topics/higher-level-topics/organizing-inbound-data/how-data-progresses-through-csvpath-framework/validation-and-upgrading/run-using-the-api.md).

# Run Using the API

<figure><img src="/files/sOJO0fUDmL1XAiLA3jMW" alt=""><figcaption><p>Running a named-paths group against one or more files</p></figcaption></figure>

Runs of a named-paths group take one of six forms. Three run the csvpaths in the group in serial, one after another. The other three run the csvpaths in the group in a breadth-first manner, line-by-line. Each approach has its advantages; though, in practice you most often don't have a reason to choose one over the other.

Regardless or serial or breadth-first or serial, there are three main options:&#x20;

* `collect_paths()` — Collect each matching line (and optionally, separately collect unmatched lines)
* `fast_forward_paths()` — Collect none of the file data, but still collect variables, metadata, errors, and printouts, as well as optionally transferring files and firing alerts
* `next_paths()` — Iterate line by line through the file receiving back the matched lines

The method names above are for serial runs. For breadth-first runs the methods are `collect_by_line()`, `fast_forward_by_line()`, and `next_by_line()`.

```python
from csvpath import CsvPaths
CsvPath().fast_forward_paths( pathsname="orders", filename="acme-orders" )
```


---

# 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://www.csvpath.org/topics/higher-level-topics/organizing-inbound-data/how-data-progresses-through-csvpath-framework/validation-and-upgrading/run-using-the-api.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.
