Skip to content

Commit f724f41

Browse files
authored
docs: Update key-value store page (#2142)
Resolves issue #2124 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Expands Console actions section, adds an authentication tip block for API usage, and fixes wording/formatting including key length limit. > > - **Console usage** > - Merge and clarify instructions for viewing a store and using the `Actions` menu (rename/share and retention note). > - Add explicit list of record operations at page bottom: upload, view, download (single/all), copy links, delete. > - Reorder images around the records section. > - **API** > - Convert authentication note into a `:::tip` block; recommend `Authorization` header and link to API integration docs. > - **SDK docs** > - Fix wording typos: "your Actor" in JavaScript and Python sections. > - Format `{KEY}` and `{EXT}` with backticks in Python section. > - **Limits** > - Clarify phrasing of key length limit: "The maximum length for a key in a key-value store is 63 characters." > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c369b36. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 6615f53 commit f724f41

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed
10.1 KB
Loading

sources/platform/storage/key_value_store.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,32 @@ In [Apify Console](https://console.apify.com), you can view your key-value store
3737

3838
![Key-value stores in app](./images/key-value-stores-app.png)
3939

40-
To view a key-value store's content, click on its **Store ID**.
41-
Under the **Actions** menu, you can rename your store (and, in turn extend its [retention period](/platform/storage/usage#named-and-unnamed-storages)) and grant [access rights](../collaboration/index.md) using the **Share** button.
40+
To view a key-value store's content, click on its **Store ID**. Under the **Actions** menu, you can rename your store (which extends its [retention period](/platform/storage/usage#named-and-unnamed-storages)) and grant [access rights](../collaboration/index.md) using the **Share** button.
4241
Click on the **API** button to view and test a store's [API endpoints](/api/v2/storage-key-value-stores).
4342

44-
4543
![Key-value stores detail](./images/key-value-stores-detail-header.png)
4644

47-
On the bottom of the page, you can view, download, and delete the individual records.
45+
At the bottom of the page, you can work with records in your key-value store:
4846

49-
![Key-value stores detail](./images/key-value-stores-detail-records.png)
47+
- Upload one or more new records and set their keys.
48+
- View individual records.
49+
- Download individual records, or download all records at once.
50+
- Copy shareable links to records.
51+
- Delete records.
5052

53+
![Key-value stores detail](./images/key-value-stores-detail-records.png)
5154

5255
### Apify API
5356

5457
The [Apify API](/api/v2/storage-key-value-stores) enables you programmatic access to your key-value stores using [HTTP requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods).
5558

5659
If you are accessing your datasets using the `username~store-name` [store ID format](./index.md), you will need to use your secret API token. You can find the token (and your user ID) on the [Integrations](https://console.apify.com/account#/integrations) tab of **Settings** page of your Apify account.
5760

58-
> When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL. ([More info](../integrations/programming/api.md#authentication)).
61+
:::tip Authentication
62+
63+
When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL. For more information, refer to the [API integration](../integrations/programming/api.md#authentication) documentation.
64+
65+
:::
5966

6067
To retrieve a list of your key-value stores, send a GET request to the [Get list of key-value stores](/api/v2/key-value-stores-get) endpoint.
6168

@@ -138,7 +145,7 @@ When working with a JavaScript [Actor](../actors/index.mdx), the [JavaScript SDK
138145

139146
Additionally, you can iterate over the keys in your store using the [`forEachKey()`](/sdk/js/reference/class/KeyValueStore#forEachKey) method.
140147

141-
Every Actor run is linked to a default key-value store that is automatically created for that specific run. If you're running your Actors and opt to store data locally, you can easily supply the [input](../actors/running/input_and_output.md) by placing an _INPUT.json_ file in the corresponding directory of the default key-value store. This method ensures that you Actor has all the necessary data readily available for its execution.
148+
Every Actor run is linked to a default key-value store that is automatically created for that specific run. If you're running your Actors and opt to store data locally, you can easily supply the [input](../actors/running/input_and_output.md) by placing an _INPUT.json_ file in the corresponding directory of the default key-value store. This method ensures that your Actor has all the necessary data readily available for its execution.
142149

143150
You can find _INPUT.json_ and other key-value store files in the location below.
144151

@@ -202,15 +209,15 @@ Check out the [JavaScript SDK documentation](/sdk/js/docs/guides/result-storage#
202209

203210
For Python [Actor](../actors/index.mdx), the [Python SDK](/sdk/python/docs/concepts/storages#working-with-key-value-stores) is essential. The key-value store is represented by a [`KeyValueStore`](/sdk/python/reference/class/KeyValueStore) class. You can use this class to specify whether your data is stored locally or in the Apify cloud. For further data manipulation it offers [`get_value()`](/sdk/python/reference/class/KeyValueStore#get_value) and [`set_value()`](/sdk/python/reference/class/KeyValueStore#set_value) methods to retrieve and assign values, respectively.
204211

205-
Every Actor run is linked to a default key-value store that is automatically created for that specific run. If you're running your Actors and opt to store data locally, you can easily supply the [input](../actors/running/input_and_output.md) by placing an _INPUT.json_ file in the corresponding directory of the default key-value store. This method ensures that you Actor has all the necessary data readily available for its execution.
212+
Every Actor run is linked to a default key-value store that is automatically created for that specific run. If you're running your Actors and opt to store data locally, you can easily supply the [input](../actors/running/input_and_output.md) by placing an _INPUT.json_ file in the corresponding directory of the default key-value store. This method ensures that your Actor has all the necessary data readily available for its execution.
206213

207214
You can find _INPUT.json_ and other key-value store files in the location below.
208215

209216
```text
210217
{APIFY_LOCAL_STORAGE_DIR}/key_value_stores/{STORE_ID}/{KEY}.{EXT}
211218
```
212219

213-
The default key-value store's ID is _default_. The \{KEY} is the record's _key_ and \{EXT} corresponds to the record value's MIME content type.
220+
The default key-value store's ID is _default_. The `{KEY}` is the record's _key_ and `{EXT}` corresponds to the record value's MIME content type.
214221

215222
To manage your key-value stores, you can use the following methods. See the `KeyValueStore` class [documentation](/sdk/python/reference/class/KeyValueStore) for the full list.
216223

@@ -330,4 +337,4 @@ Key-value storage uses the [AWS S3](https://aws.amazon.com/s3/) service. Accordi
330337

331338
## Limits
332339

333-
- The maximum length for key of key-value store is 63 characters.
340+
- The maximum length for a key in a key-value store is 63 characters.

0 commit comments

Comments
 (0)