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

# Upload and search your content

It will only take you a few minutes. This guide walks you through:

✅ Set up authentication (API key) <br />
✅ Create two sample files to upload <br />
✅ Upload private files via the **Content API** <br />
✅ Query bigdata.com with the **Search API** <br />

<Check>
  Private & Secure: No LLM training on your data
</Check>

**Ready to get started?** Run the examples below in your terminal (or open the notebook in Colab). All requests use the REST API with your API key in the `X-API-KEY` header.

<a href="https://colab.research.google.com/drive/1t-f_T7Hvy6OXP2ZRrGuhlxnYmW2eYPmi?usp=sharing" target="_blank">
  <img alt="Open in Colab" noZoom src="https://colab.research.google.com/assets/colab-badge.svg" />
</a>

# Set up authentication

Send your API key in the `X-API-KEY` header on every request. See [Authentication](/api-rest/introduction) for details. Replace `YOUR_API_KEY` in the examples with your key.

# Create two sample files to upload

Create the following two sample files in your local directory.

File name `data_science_research-2020-06.txt`:

```text theme={null}
RavenPack Data Science researchers recommend the following stocks in June 2020

Microsoft (NASDAQ: MSFT): Microsoft has been heavily investing in AI and cloud computing, which are key growth areas for the company.

Datadog (NASDAQ: DDOG): Datadog is a leading provider of monitoring and analytics solutions for cloud-based applications.

Oracle (NYSE: ORCL): Oracle is a major player in the enterprise software and cloud computing market.
```

File name `soup_recipes-2020-06.txt`:

```text theme={null}
We recommend making chicken noodle soup with homemade chicken stock
```

# Upload private files (Content API)

Upload the two files using the [Content API](/api-rest/content_introduction): request a pre-signed URL and document id with **POST /contents/v1/documents**, then **PUT** the file to that URL. Bigdata enriches each document (extraction, structure and annotation of the content) and indexes it, making it available for Search and Research Agent. Use `published_ts` to set the document date (so we can narrow search to June 2020) and `tags` to filter by type later.

**1. Request upload URL and upload the first file**

```bash theme={null}
# Request a pre-signed URL (replace YOUR_API_KEY with your key)
RESP=$(curl -s -X POST 'https://api.bigdata.com/contents/v1/documents' \
  -H 'X-API-KEY: YOUR_API_KEY' \
  -d '{
    "file_name": "data_science_research-2020-06.txt",
    "published_ts": "2020-06-10T12:00:00Z",
    "tags": ["Data Science Research"],
    "share_with_org": false
  }')

# Extract the URL (e.g. with jq) and PUT the file
URL=$(echo $RESP | jq -r '.url')
curl -X PUT "$URL" --data-binary '@./data_science_research-2020-06.txt'
```

**2. Request upload URL and upload the second file**

```bash theme={null}
RESP=$(curl -s -X POST 'https://api.bigdata.com/contents/v1/documents' \
  -H 'X-API-KEY: YOUR_API_KEY' \
  -d '{
    "file_name": "soup_recipes-2020-06.txt",
    "published_ts": "2020-06-10T12:00:00Z",
    "tags": ["Cooking recipes"],
    "share_with_org": false
  }')

URL=$(echo $RESP | jq -r '.url')
curl -X PUT "$URL" --data-binary '@./soup_recipes-2020-06.txt'
```

After each PUT, Bigdata enriches and indexes the document. The POST response includes an **id** (content ID); use it with [Get document metadata](/api-reference/documents/get-document-metadata) to poll `status` until it is `completed`. See [Upload your own content](/getting-started/upload_your_own_content) for full details.

# Query bigdata.com

Run a similarity search for "recommend stock" in June 2020. To search only your uploaded files, filter by category `my_files`.

Use **POST /v1/search** with a `query` that has `text` (for similarity) and `filters` for timestamp and document category. To restrict results to your uploaded files, set `category` to `my_files`.

**Similarity search in June 2020 (all sources):**

```bash theme={null}
curl -X POST 'https://api.bigdata.com/v1/search' \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY' \
  --data '{
    "query": {
      "text": "recommend stock",
      "filters": {
        "timestamp": {
          "start": "2020-06-01T00:00:00.000Z",
          "end": "2020-06-30T23:59:59.999Z"
        }
      },
      "max_chunks": 10
    }
  }'
```

**Search only your uploaded files (my\_files):**

```bash theme={null}
curl -X POST 'https://api.bigdata.com/v1/search' \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY' \
  --data '{
    "query": {
      "text": "recommend stock",
      "filters": {
        "timestamp": {
          "start": "2020-06-01T00:00:00.000Z",
          "end": "2020-06-30T23:59:59.999Z"
        },
        "category": {
          "mode": "INCLUDE",
          "values": ["my_files"]
        }
      },
      "max_chunks": 10
    }
  }'
```

**Narrow to the publication window of your files (2 seconds around 2020-06-10 12:00:00):**

```bash theme={null}
curl -X POST 'https://api.bigdata.com/v1/search' \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY' \
  --data '{
    "query": {
      "text": "recommend stock",
      "filters": {
        "timestamp": {
          "start": "2020-06-10T11:59:59.000Z",
          "end": "2020-06-10T12:00:01.000Z"
        },
        "category": {
          "mode": "INCLUDE",
          "values": ["my_files"]
        }
      },
      "max_chunks": 10
    }
  }'
```

You should see your two documents (e.g. `data_science_research-2020-06.txt` and `soup_recipes-2020-06.txt`) in the results.

**Filter by tag (e.g. only "Data Science Research"):**

Use the `tag` filter with `any_of` to restrict to documents that have a specific tag. See [Search API: tag filter](/api-reference/search/search-documents#body-query-filters-tag).

```bash theme={null}
curl -X POST 'https://api.bigdata.com/v1/search' \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY' \
  --data '{
    "query": {
      "text": "recommend stock",
      "filters": {
        "timestamp": {
          "start": "2020-06-01T00:00:00.000Z",
          "end": "2020-06-30T23:59:59.999Z"
        },
        "category": {
          "mode": "INCLUDE",
          "values": ["my_files"]
        },
        "tag": {
          "any_of": ["Data Science Research"]
        }
      },
      "max_chunks": 10
    }
  }'
```

# Summary

Congratulations! You have uploaded private files with the **Content API** and queried them via the **Search API**.

<Tip>
  **Related documentation**

  * [Upload your own content](/getting-started/upload_your_own_content): Full guide to the Content API (upload, list, tags, delete).
  * [Content API introduction](/api-rest/content_introduction): Connectors vs direct upload, and document operations.
  * [Search API filters](/getting-started/search/query_filters):
    * All search filters, including [Tags](/getting-started/search/query_filters#filetag)
    * Use the [Search API category/source filter](/api-reference/search/search-documents#body-query-filters-category) to restrict your query to your uploaded files only.
  * [Research Agent search tool filters](/api-reference/research-agent/research-agent#body-tools-configs-one-of-0-search):
    * Restrict context to just your proprietary content applying [content filters](/api-reference/research-agent/research-agent#body-tools-configs-one-of-0-search-query-filters-content-one-of-0-any-of-items-document-types-items-one-of-4-tags).
    * Narrow the scope of the agent with [tags](/api-reference/research-agent/research-agent#body-tools-configs-one-of-0-search-query-filters-content-one-of-0-any-of-items-document-types-items-one-of-4-tags).
  * [Batch files upload](./batch-files-upload): Script for uploading many files.
</Tip>

Click on the playgrounds below, use the source selector and filter by **My Files** to test and retrieve your uploaded content.

<Columns cols={2}>
  <Card title="Search Service Playground" icon="magnifying-glass" href="https://platform.bigdata.com/search/search-documents" horizontal>
    Search across your private content and other sources. In the playground, open the source selector and choose **My Files** to limit results to your uploaded documents.
  </Card>

  <Card title="Research Agent Playground" icon="robot" href="https://platform.bigdata.com/research-agent" horizontal>
    Run research over your private content and real-time data. In the playground, use the source selector and filter by **My Files** to ground answers in your documents.
  </Card>
</Columns>
