# Downloading results

Every results page has buttons that download what the search found: **URLs**, **CSV** and **CSV+snippets**. A signed-in account also has **Cluster**, which saves the results instead of downloading them. Rows come in the same order as on the results page.

## What each button gives

| Button | File | Each line |
| --- | --- | --- |
| URLs | `statichotjarcom.txt` | The address of the page that matched. |
| CSV | `statichotjarcom.csv` | `url;rank` |
| CSV+snippets | `statichotjarcom-snippets.csv` | `url;rank;snippets` |
| Cluster | - | The domains are saved as a [cluster](https://publicwww.com/docs/clusters/creating/); the message says how many of the results went in. |

The file is named after the query with everything but Latin letters, digits, `-` and `_` left out: `"static.hotjar.com"` gives `statichotjarcom.csv`.

## The format

- UTF-8. The first line of CSV and CSV+snippets names the columns: `url;rank` or `url;rank;snippets`. The URLs file has no such line.
- Columns are separated by a semicolon `;`. A cell that contains a semicolon, a comma, a tab, a double quote or a line break is put in double quotes, and a quote inside it is doubled. This is standard CSV: a spreadsheet or a CSV library reads it as is, with the semicolon chosen as the separator, and a cell stays whole even if the comma or the tab is chosen too.
- Rank is the site's place in the popularity ranking. It is empty for a site that has no rank.
- All snippets of one page are in one cell, joined with `...`.
- A snippet that starts with `=`, `+`, `-` or `@` gets an apostrophe in front, so a spreadsheet shows it instead of running it as a formula. Numbers such as phone numbers are left as they are.

## How many rows

Rows are taken from the top of the results, up to the plan's limit: **Results / each search or download** for URLs and CSV, **Download with snippets (rows)** for CSV+snippets. The numbers are on the [Pricing](https://publicwww.com/prices.html) page. Without signing in, a file holds the first page of results: up to 20 rows.

Websites hidden on your plan - the rows shown as **Sign up to view** or **Upgrade to view** - are not in the file. Results go by popularity and the hidden websites come after the open ones, so a file can be shorter than the limit, or have no rows at all; then the download buttons are inactive.

The hint on each button says how many rows the file will have, for example *7 of 1,059 rows: websites hidden on your plan are not downloaded*. When the page does not show where the open rows end, it says *At most*: the file stops at the first website hidden on your plan, which may come sooner.

When the file is shorter than the results, its last line says why:

```
# Truncated at the plan limit: 1000 of 22694 results.
# 7 of 1059 results: websites hidden on your plan are left out.
```

The first form means the plan's row limit was reached, the second that the websites hidden on your plan were left out. The line starts with `#` and is written in the language of the site you downloaded from (the examples above are from the English one); its numbers have no thousands separator. It is not a result: skip it when reading the file into a program. When it is not there, the file holds all the results.

A download is charged like the search itself: one search from the daily allowance, and CSV+snippets also one download with snippets - see [quotas and rate limits](https://publicwww.com/docs/api/limits/). When the day's searches are used up, a download carries what the free plan allows, and the last line says the file was cut.

## From a script

The buttons are links on the results page; the address in them works for ten minutes from the network address that opened the page. To download from your own code, use the [API](https://publicwww.com/docs/api/): `/v1/search` with `format=csv` or `format=txt`. The [old export urls](https://publicwww.com/docs/api/legacy/) with `?key=` keep their old format exactly: cells are not quoted, there is no last line, and a site without a rank shows `>30M`.

## Other downloads

- **A cluster** - the download icon in the list of [clusters](https://publicwww.com/profile/clusters/) gives a text file of its domains, one per line.
- **Extraction** - a CSV separated by commas, not semicolons, with a header row: the domain, then one column per expression. Several values found on one site share a cell, one per line. The last line, starting with `#`, says how many extraction points the run used; when the day's points run out, the line before it says where to continue. See [Extraction](https://publicwww.com/docs/clusters/extraction/).

Source: https://publicwww.com/docs/search/downloads/
