> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scanoss.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage

> The `scanoss` package can be imported directly into your own Python projects and scripts via `scanoss.scanner`.

## Basic Usage

To run a basic scan, import the `Scanner` class and call `scan_folder_with_options`. By default, results are written to stdout as JSON:

```python theme={null}
from scanoss.scanner import Scanner
from scanoss.scanoss_settings import ScanossSettings

def main():
    scanner = Scanner(scanoss_settings=ScanossSettings())
    scanner.scan_folder_with_options('/path/to/project')

if __name__ == "__main__":
    main()
```

> **Note:** `ScanossSettings()` is initialised here with its default values. Replace `'/path/to/project'` with the path to the directory you want to scan.

## Saving Results to a File

To write results to a file rather than stdout, pass the desired output path as the **`scan_output`** argument to the `Scanner` constructor:

```python theme={null}
from scanoss.scanner import Scanner
from scanoss.scanoss_settings import ScanossSettings

def main():
    scanner = Scanner(
        scan_output='results.json',
        scanoss_settings=ScanossSettings(),
    )
    scanner.scan_folder_with_options('/path/to/project')

if __name__ == "__main__":
    main()
```

For information on configuring a custom API endpoint or providing an API key, see the [Authentication](authentication) page.
