Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api-reference/api-services/accessing-unstructured-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Choose your preferred method:

The API parameters for all these methods are documented on the [API parameters](/api-reference/api-services/api-parameters) page.

import UseIngestInstead from '/snippets/general-shared-text/use-ingest-instead.mdx';
import UseIngestOrPlatformInstead from '/snippets/general-shared-text/use-ingest-or-platform-instead.mdx';

<UseIngestInstead />
<UseIngestOrPlatformInstead />

If you'd like to try out the Unstructured API interactively by using the Free Unstructured API to process a single file, you can do so by using the [Swagger UI](https://api.unstructured.io/general/docs#/default/pipeline_1_general_v0_general_post).

Expand Down
72 changes: 41 additions & 31 deletions api-reference/api-services/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import NoURLForServerlessAPI from '/snippets/general-shared-text/no-url-for-serv

<NoURLForServerlessAPI/>

import UseIngestInstead from '/snippets/general-shared-text/use-ingest-instead.mdx';
import UseIngestOrPlatformInstead from '/snippets/general-shared-text/use-ingest-or-platform-instead.mdx';

### Changing partition strategy for a PDF

Expand Down Expand Up @@ -82,7 +82,7 @@ The `hi_res` strategy supports different models, and the default is `layout_v1.1
```
</Accordion>
<Accordion title="POST">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```bash POST
curl -X 'POST' $UNSTRUCTURED_API_URL \
-H 'accept: application/json' \
Expand All @@ -94,7 +94,7 @@ The `hi_res` strategy supports different models, and the default is `layout_v1.1
```
</Accordion>
<Accordion title="Python SDK">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```python Python
import asyncio
import os
Expand All @@ -103,8 +103,7 @@ The `hi_res` strategy supports different models, and the default is `layout_v1.1
from unstructured_client.models import shared

client = unstructured_client.UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")
)

async def call_api(filename, input_dir, output_dir):
Expand All @@ -123,7 +122,10 @@ The `hi_res` strategy supports different models, and the default is `layout_v1.1
}

try:
res = await client.general.partition_async(request=req)
res = await client.general.partition_async(
request=req,
server_url=os.getenv("UNSTRUCTURED_API_URL")
)
element_dicts = [element for element in res.elements]
json_elements = json.dumps(element_dicts, indent=2)

Expand Down Expand Up @@ -159,7 +161,7 @@ The `hi_res` strategy supports different models, and the default is `layout_v1.1
```
</Accordion>
<Accordion title="JavaScript/TypeScript SDK">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```typescript TypeScript
import { UnstructuredClient } from "unstructured-client";
import * as fs from "fs";
Expand Down Expand Up @@ -300,7 +302,7 @@ For better OCR results, you can specify what languages your document is in using
```
</Accordion>
<Accordion title="POST">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```bash POST
curl -X 'POST' $UNSTRUCTURED_API_URL \
-H 'accept: application/json' \
Expand All @@ -312,7 +314,7 @@ For better OCR results, you can specify what languages your document is in using
```
</Accordion>
<Accordion title="Python SDK">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```python Python
import asyncio
import os
Expand All @@ -321,8 +323,7 @@ For better OCR results, you can specify what languages your document is in using
from unstructured_client.models import shared

client = unstructured_client.UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")
)

async def call_api(filename, input_dir, output_dir):
Expand All @@ -341,7 +342,10 @@ For better OCR results, you can specify what languages your document is in using
}

try:
res = await client.general.partition_async(request=req)
res = await client.general.partition_async(
request=req,
server_url=os.getenv("UNSTRUCTURED_API_URL")
)
element_dicts = [element for element in res.elements]
json_elements = json.dumps(element_dicts, indent=2)

Expand Down Expand Up @@ -377,7 +381,7 @@ For better OCR results, you can specify what languages your document is in using
```
</Accordion>
<Accordion title="JavaScript/TypeScript SDK">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```typescript TypeScript
import { UnstructuredClient } from "unstructured-client";
import * as fs from "fs";
Expand Down Expand Up @@ -515,7 +519,7 @@ Set the `coordinates` parameter to `true` to add this field to the elements in t
```
</Accordion>
<Accordion title="POST">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```bash POST
curl -X 'POST' $UNSTRUCTURED_API_URL \
-H 'accept: application/json' \
Expand All @@ -527,7 +531,7 @@ Set the `coordinates` parameter to `true` to add this field to the elements in t
```
</Accordion>
<Accordion title="Python SDK">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```python Python
import asyncio
import os
Expand All @@ -536,8 +540,7 @@ Set the `coordinates` parameter to `true` to add this field to the elements in t
from unstructured_client.models import shared

client = unstructured_client.UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")
)

async def call_api(filename, input_dir, output_dir):
Expand All @@ -556,7 +559,10 @@ Set the `coordinates` parameter to `true` to add this field to the elements in t
}

try:
res = await client.general.partition_async(request=req)
res = await client.general.partition_async(
request=req,
server_url=os.getenv("UNSTRUCTURED_API_URL")
)
element_dicts = [element for element in res.elements]
json_elements = json.dumps(element_dicts, indent=2)

Expand Down Expand Up @@ -592,7 +598,7 @@ Set the `coordinates` parameter to `true` to add this field to the elements in t
```
</Accordion>
<Accordion title="JavaScript/TypeScript SDK">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```typescript TypeScript
import { UnstructuredClient } from "unstructured-client";
import * as fs from "fs";
Expand Down Expand Up @@ -734,7 +740,7 @@ This can be helpful if you'd like to use the IDs as a primary key in a database,
```
</Accordion>
<Accordion title="POST">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```bash POST
curl -X 'POST' $UNSTRUCTURED_API_URL \
-H 'accept: application/json' \
Expand All @@ -745,7 +751,7 @@ This can be helpful if you'd like to use the IDs as a primary key in a database,
```
</Accordion>
<Accordion title="Python SDK">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```python Python
import asyncio
import os
Expand All @@ -754,8 +760,7 @@ This can be helpful if you'd like to use the IDs as a primary key in a database,
from unstructured_client.models import shared

client = unstructured_client.UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")
)

async def call_api(filename, input_dir, output_dir):
Expand All @@ -774,7 +779,10 @@ This can be helpful if you'd like to use the IDs as a primary key in a database,
}

try:
res = await client.general.partition_async(request=req)
res = await client.general.partition_async(
request=req,
server_url=os.getenv("UNSTRUCTURED_API_URL")
)
element_dicts = [element for element in res.elements]
json_elements = json.dumps(element_dicts, indent=2)

Expand Down Expand Up @@ -810,7 +818,7 @@ This can be helpful if you'd like to use the IDs as a primary key in a database,
```
</Accordion>
<Accordion title="JavaScript/TypeScript SDK">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```typescript TypeScript
import { UnstructuredClient } from "unstructured-client";
import * as fs from "fs";
Expand Down Expand Up @@ -956,7 +964,7 @@ By default, the `chunking_strategy` is set to `None`, and no chunking is perform
```
</Accordion>
<Accordion title="POST">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```bash POST
curl -X 'POST' $UNSTRUCTURED_API_URL \
-H 'accept: application/json' \
Expand All @@ -969,7 +977,7 @@ By default, the `chunking_strategy` is set to `None`, and no chunking is perform
```
</Accordion>
<Accordion title="Python SDK">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```python Python
import asyncio
import os
Expand All @@ -978,8 +986,7 @@ By default, the `chunking_strategy` is set to `None`, and no chunking is perform
from unstructured_client.models import shared

client = unstructured_client.UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")
)

async def call_api(filename, input_dir, output_dir):
Expand All @@ -999,7 +1006,10 @@ By default, the `chunking_strategy` is set to `None`, and no chunking is perform
}

try:
res = await client.general.partition_async(request=req)
res = await client.general.partition_async(
request=req,
server_url=os.getenv("UNSTRUCTURED_API_URL")
)
element_dicts = [element for element in res.elements]
json_elements = json.dumps(element_dicts, indent=2)

Expand Down Expand Up @@ -1035,7 +1045,7 @@ By default, the `chunking_strategy` is set to `None`, and no chunking is perform
```
</Accordion>
<Accordion title="JavaScript/TypeScript SDK">
<UseIngestInstead />
<UseIngestOrPlatformInstead />
```typescript TypeScript
import { UnstructuredClient } from "unstructured-client";
import * as fs from "fs";
Expand Down
4 changes: 2 additions & 2 deletions api-reference/api-services/partition-via-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ would like to leverage the advanced capabilities of Unstructured API services, y
Whether you're using the Free Unstructured API, the Unstructured Serverless API,
the Unstructured API on Azure/AWS, or your local deployment of the Unstructured API, you can use the open source library to send an individual file through `partition_via_api` for processing with Unstructured API services.

import UseIngestInstead from '/snippets/general-shared-text/use-ingest-instead.mdx';
import UseIngestOrPlatformInstead from '/snippets/general-shared-text/use-ingest-or-platform-instead.mdx';

<UseIngestInstead />
<UseIngestOrPlatformInstead />

To use the open source library, you'll also need:

Expand Down
4 changes: 2 additions & 2 deletions api-reference/api-services/post-requests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ sidebarTitle: POST request
Whether you're using the free Unstructured API, the Unstructured Serverless API, Unstructured API on Azure/AWS, or your local
deployment of Unstructured API, you can work with the API by sending single-file POST requests to it.

import UseIngestInstead from '/snippets/general-shared-text/use-ingest-instead.mdx';
import UseIngestOrPlatformInstead from '/snippets/general-shared-text/use-ingest-or-platform-instead.mdx';

<UseIngestInstead />
<UseIngestOrPlatformInstead />

To make POST requests, you will need:

Expand Down
4 changes: 2 additions & 2 deletions api-reference/api-services/sdk-jsts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ The [Unstructured JavaScript/TypeScript SDK](https://github.com/Unstructured-IO/
Free Unstructured API, the Unstructured Serverless API, the Unstructured API on Azure/AWS, or your local
deployment of the Unstructured API, you can access the API using the JavaScript/TypeScript SDK.

import UseIngestInstead from '/snippets/general-shared-text/use-ingest-instead.mdx';
import UseIngestOrPlatformInstead from '/snippets/general-shared-text/use-ingest-or-platform-instead.mdx';

<UseIngestInstead />
<UseIngestOrPlatformInstead />

To use the JavaScript/TypeScript SDK, you'll need:

Expand Down
Loading