You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Important**: Beginning with Python SDK 0.30.0, note the following:
16
+
17
+
- For the Unstructured Serverless API URL, do not use `https://api.unstructuredapp.io/general/v0/general`, or else calls made by
18
+
the Python SDK will fail. Use `https://api.unstructuredapp.io` instead.
19
+
- For the Free Unstructured API URL, do not use `https://api.unstructured.io/general/v0/general`, or else calls made by
20
+
the Python SDK will fail. Use `https://api.unstructured.io` instead.
21
+
- If your Python code previously used the `server_url` parameter inside of your `UnstructuredClient` constructor to specify your Unstructured API URL, you must move this `server_url` parameter into
22
+
your code's `partition` or `partition_async` function calls instead, or else calls made by the Python SDK will fail. To learn how, see the following code examples.
Copy file name to clipboardExpand all lines: api-reference/api-services/free-api.mdx
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,17 @@ The Free Unstructured API requires authentication via an API key. Here's how you
19
19
5. Click **Submit**. You will receive a Free Unstructured API key at the **Email** you provided. Store your API key in a secure location. Do not share it with others.
20
20
6. For the Free Unstructured API, the API URL is `https://api.unstructured.io/general/v0/general`
21
21
22
+
<Warning>
23
+
**Important**: This article shows how to use Free Unstructured API with the Unstructured CLI and the
24
+
Unstructured Ingest Python library. While you can also use this API URL with the Unstructured Python SDK,
25
+
beginning with Python SDK 0.30.0, note the following:
26
+
27
+
- Do not use https://api.unstructured.io/general/v0/general, or else calls made by
28
+
the Python SDK will fail. Use https://api.unstructured.io` instead.
29
+
- If your Python code uses the `server_url` parameter inside of your `UnstructuredClient` constructor to specify this URL, you must move this `server_url` parameter into
30
+
your code's `partition` or `partition_async` function calls instead, or else calls made by the Python SDK will fail.
Copy file name to clipboardExpand all lines: api-reference/api-services/sdk-python.mdx
+17-5Lines changed: 17 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,19 @@ import SharedAPIKeyURL from '/snippets/general-shared-text/api-key-url.mdx';
18
18
19
19
<SharedAPIKeyURL />
20
20
21
+
<Warning>
22
+
**Important**: Beginning with Python SDK 0.30.0, note the following:
23
+
24
+
- For the Unstructured Serverless API URL, do not use `https://api.unstructuredapp.io/general/v0/general`, or else calls made by
25
+
the Python SDK will fail. Use `https://api.unstructuredapp.io` instead.
26
+
- For the Free Unstructured API URL, do not use `https://api.unstructured.io/general/v0/general`, or else calls made by
27
+
the Python SDK will fail. Use `https://api.unstructured.io` instead.
28
+
- If your Python code previously used the `server_url` parameter inside of your `UnstructuredClient` constructor to specify your Unstructured API URL, you must move this `server_url` parameter into
29
+
your code's `partition` or `partition_async` function calls instead, or else calls made by the Python SDK will fail. To learn how, see the following code examples.
@@ -309,18 +322,19 @@ the names used in the SDKs are the same across all methods.
309
322
310
323
## Migration guide
311
324
312
-
There are major breaking changes in 0.30.0. If you encounter any errors when upgrading, please find the solution below.
325
+
There are breaking changes beginning with Python SDK version 0.26.0 and again in 0.30.0. If you encounter any errors when upgrading, please find the solution below.
313
326
314
327
**If you see the error: `404 Not Found`**
315
328
316
329
Before 0.30.0, you could specify the following Unstructured API URL for the `server_url` parameter:
317
330
318
331
- For the Unstructured Serverless API: `https://api.unstructuredapp.io/general/v0/general`
332
+
- For the Free Unstructured API: `https://api.unstructured.io/general/v0/general`
319
333
320
-
Beginning with 0.30.0, these Unstructured API URLs have changed as follows, respectively:
334
+
Beginning with 0.30.0, these Unstructured API URLs have changed as follows:
321
335
322
336
- For the Unstructured Serverless API: `https://api.unstructuredapp.io` (remove `/general/v0/general`)
323
-
-(New beginning with 0.30.0) For the Unstructured Platform API: `https://platform.unstructuredapp.io` (remove `/api/v1`)
337
+
- For the Free Unstructured API: `https://api.unstructured.io` (remove `/general/v0/general`)
324
338
325
339
Also, before 0.30.0, the `server_url` parameter was part of the `UnstructuredClient` constructor. Beginning with 0.30.0, the `server_url`
326
340
parameter has been moved into the `partition` and `partition_async` functions.
@@ -352,8 +366,6 @@ res = await client.general.partition_async(
352
366
)
353
367
```
354
368
355
-
There are minor breaking changes beginning with 0.26.0. If you encounter any errors when upgrading, please find the solution below.
356
-
357
369
**If you see the error: `AttributeError: 'PartitionParameters' object has no attribute 'partition_parameters'`**
358
370
359
371
Before 0.26.0, the SDK accepted a `PartitionParameters` object as input to the `sdk.general.partition` function. Beginning with 0.26.0, this object must be wrapped in a `PartitionRequest` object. The old behavior was deprecated in 0.23.0 and removed in 0.26.0.
Copy file name to clipboardExpand all lines: api-reference/troubleshooting/api-key-url.mdx
+52-5Lines changed: 52 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,9 @@ For the API URL, note the following:
43
43
- For the [Unstructured Serverless API](/api-reference/api-services/saas-api-development-guide), the API URL is typically `https://api.unstructuredapp.io`, which is unique to
44
44
the Unstructured Python SDK, beginning with 0.30.0; and `https://api.unstructuredapp.io/general/v0/general` for the Unstructured Python SDK before 0.30.0 and for standard REST-enabled utilities (such as `curl`),
45
45
tools (such as Postman), programming languages, packages, and libraries. Be aware of the inclusion of `app` in this API URL.
46
-
- For the [Free Unstructured API](/api-reference/api-services/free-api), the API URL is always `https://api.unstructured.io/general/v0/general`. Be aware that there is no `app` in this API URL.
46
+
- For the [Free Unstructured API](/api-reference/api-services/free-api), the API URL is typically https://api.unstructured.io`, which is unique to
47
+
the Unstructured Python SDK, beginning with 0.30.0; and `https://api.unstructured.io/general/v0/general` for the Unstructured Python SDK before 0.30.0 and for standard REST-enabled utilities (such as `curl`),
48
+
tools (such as Postman), programming languages, packages, and libraries. Be aware that there is no `app` in this API URL.
47
49
48
50
<Note>The free 14-day trial of the Unstructured Serverless API or Unstructured Platform API is different than the Free Unstructured API.</Note>
49
51
@@ -65,11 +67,19 @@ For the API key, note the following:
65
67
- For the Unstructured Platform API URL, do not use `https://platform.unstructuredapp.io/api/v1`, or else calls made by
66
68
the Python SDK will fail. Use `https://platform.unstructuredapp.io` instead.
67
69
- For the Unstructured Serverless API URL, do not use `https://api.unstructuredapp.io/general/v0/general`, or else calls made by
68
-
the Python SDK will fail. Use `https://api.unstructuredapp.io` instead.
70
+
the Python SDK will fail. Use `https://api.unstructuredapp.io` instead.
71
+
- For the Free Unstructured API URL, do not use https://api.unstructured.io/general/v0/general, or else calls made by
72
+
the Python SDK will fail. Use https://api.unstructured.io` instead.
69
73
</Warning>
70
74
71
75
- For the [Free Unstructured API](/api-reference/api-services/free-api), the API key is in your original email from Unstructured. If you cannot find the original email, you can regenerate it by going to [https://unstructured.io/api-key-free](https://unstructured.io/api-key-free).
72
76
77
+
<Warning>
78
+
**Important**: For the Unstructured Python SDK beginning with 0.30.0,
79
+
for the Free Unstructured API URL, do not use https://api.unstructured.io/general/v0/general, or else calls made by
80
+
the Python SDK will fail. Use https://api.unstructured.io` instead.
81
+
</Warning>
82
+
73
83
<Note>The free 14-day trial of the Unstructured Serverless API or Unstructured Platform API is different than the Free Unstructured API.</Note>
74
84
75
85
If you still believe you have the correct API URL and API key, try the following steps:
@@ -83,6 +93,36 @@ If you still believe you have the correct API URL and API key, try the following
83
93
84
94
**For the Unstructured Python SDK** (Unstructured Platform API, Unstructured Serverless API, and Free Unstructured API only)
85
95
96
+
- For the Unstructured Python SDK beginning with 0.30.0, if the `server_url` parameter is in your `UnstructuredClient` constructor, move it into
97
+
your operational calling function such as `partition` or `partition_asyc` for Unstructured API services or `list_*`, `get_*`, `create_*`, `update_*`, or `delete_*` for the Unstructured Platform API. For example:
98
+
99
+
```python
100
+
# Instead of this (before Python SDK 0.30.0):
101
+
client = unstructured_client.UnstructuredClient(
102
+
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
103
+
server_url=os.getenv("UNSTRUCTURED_API_URL")
104
+
)
105
+
106
+
# Switch to this (beginning with Python SDK 0.30.0):
107
+
client = unstructured_client.UnstructuredClient(
108
+
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")
109
+
)
110
+
111
+
# And then...
112
+
113
+
# For Unstructured API services:
114
+
res = client.general.<partition|partition_async>(
115
+
request=req,
116
+
server_url=os.getenv("UNSTRUCTURED_API_URL")
117
+
)
118
+
119
+
# Or for the Unstructured Platform API:
120
+
res = client.<sources-destinations-workflows-jobs>.<list-get-create-delete-operation>(
121
+
request=req,
122
+
server_url=os.getenv("UNSTRUCTURED_API_URL")
123
+
)
124
+
```
125
+
86
126
- Check the value of the `server_url` parameter. Make sure it is set to the right API URL, or an environment variable representing the right API URL.
87
127
88
128
<Warning>
@@ -91,7 +131,9 @@ If you still believe you have the correct API URL and API key, try the following
91
131
- For the Unstructured Platform API URL, do not use `https://platform.unstructuredapp.io/api/v1`, or else calls made by
92
132
the Python SDK will fail. Use `https://platform.unstructuredapp.io` instead.
93
133
- For the Unstructured Serverless API URL, do not use `https://api.unstructuredapp.io/general/v0/general`, or else calls made by
94
-
the Python SDK will fail. Use `https://api.unstructuredapp.io` instead.
134
+
the Python SDK will fail. Use `https://api.unstructuredapp.io` instead.
135
+
- For the Free Unstructured API URL, do not use https://api.unstructured.io/general/v0/general, or else calls made by
136
+
the Python SDK will fail. Use https://api.unstructured.io` instead.
95
137
</Warning>
96
138
97
139
- Check the value of the `api_key_auth` parameter. Make sure it is set to the right API key, or an environment variable representing the right API key.
@@ -103,7 +145,7 @@ If you still believe you have the correct API URL and API key, try the following
103
145
- For `serverURL`, make sure it is set to the right API URL, or an environment variable representing the right API URL, or...
104
146
- For `server`, make sure it is set to `"saas-api"` for the Unstructured Serverless API, or `"free-api"` for the Free Unstructured API, or an environment variable representing one of these strings.
105
147
106
-
<Note>You can use `"saas-api"` and `"free-api"` only with the Unstructured SDKs.</Note>
148
+
<Note>You can use `"saas-api"` and `"free-api"` only with the Unstructured JavaScript/TypeScript SDK.</Note>
107
149
108
150
- Make sure that only `serverURL` or `server` are specified—not both.
109
151
- Make sure that if you specify `serverURL`, an actual API URL (or an environment variable representing an actual API URL) is specified (not `"saas-api"` or `"free-api"`, or an environment variable representing one of these strings).
@@ -158,13 +200,18 @@ If you still believe you have the correct API URL and API key, try the following
158
200
- For the Unstructured Platform API URL, do not use `https://platform.unstructuredapp.io/api/v1`, or else calls made by
159
201
the Python SDK will fail. Use `https://platform.unstructuredapp.io` instead.
160
202
- For the Unstructured Serverless API URL, do not use `https://api.unstructuredapp.io/general/v0/general`, or else calls made by
161
-
the Python SDK will fail. Use `https://api.unstructuredapp.io` instead.
203
+
the Python SDK will fail. Use `https://api.unstructuredapp.io` instead.
162
204
</Warning>
163
205
164
206
**For the Free Unstructured API**
165
207
166
208
- Open your original email from Unstructured that contains your API key. Make sure it matches the one in your script, code, or environment variable. If you cannot find the original email, you can regenerate it by going to [https://unstructured.io/api-key-free](https://unstructured.io/api-key-free).
167
209
- Make sure that you are using `https://api.unstructured.io/general/v0/general` (not `platform.unstructuredapp.io` or `api.unstructuredapp.io`) for the API URL.
168
210
211
+
<Warning>
212
+
**Important**: For the Unstructured Python SDK beginning with 0.30.0 for the Free Unstructured API URL, do not use https://api.unstructured.io/general/v0/general, or else calls made by
213
+
the Python SDK will fail. Use https://api.unstructured.io` instead.
214
+
</Warning>
215
+
169
216
4. If you are still getting this issue, [contact us directly](https://unstructured.io/contact).
If you do not specify the API URL, your [Unstructured Serverless API](/api-reference/api-services/saas-api-development-guide) pay-as-you-go account will be used by default. You must always specify your Serverless API key.<br/><br/>
3
-
To use the [Free Unstructured API](/api-reference/api-services/free-api), you must always specify your Free API key, and the Free API URL which is `https://api.unstructured.io/general/v0/general`<br/><br/>
3
+
To use the [Free Unstructured API](/api-reference/api-services/free-api), you must always specify your Free API key, and the Free API URL which is `https://api.unstructured.io` for the Python SDK beginning with 0.30.0; and `https://api.unstructured.io/general/v0/general` for all other clients.<br/><br/>
4
4
To use the pay-as-you-go Unstructured API on Azure or AWS with the SDKs, you must always specify the corresponding API URL. See the [Azure](/api-reference/api-services/azure) or [AWS](/api-reference/api-services/aws) instructions.
0 commit comments