Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

fix: configuration apiBaseUrl (#1095)

petrpatek60d408642162
diff --git a/src/configuration.js b/src/configuration.js
index 6450d5871..c5f51cb49 100644
--- a/src/configuration.js
+++ b/src/configuration.js
@@ -39,7 +39,7 @@ import log from './utils_log';
* `actorId` | `APIFY_ACTOR_ID` | -
* `actorRunId` | `APIFY_ACTOR_RUN_ID` | -
* `actorTaskId` | `APIFY_ACTOR_TASK_ID` | -
- * `apiBaseUrl` | `APIFY_API_BASE_URL` | `'https://api.apify.com/v2'`
+ * `apiBaseUrl` | `APIFY_API_BASE_URL` | `'https://api.apify.com'`
* `containerPort` | `APIFY_CONTAINER_PORT` | `4321`
* `containerUrl` | `APIFY_CONTAINER_URL` | `'http://localhost:4321'`
* `inputKey` | `APIFY_INPUT_KEY` | `'INPUT'`
@@ -107,7 +107,7 @@ export class Configuration {
defaultDatasetId: LOCAL_ENV_VARS[ENV_VARS.DEFAULT_DATASET_ID],
defaultRequestQueueId: LOCAL_ENV_VARS[ENV_VARS.DEFAULT_REQUEST_QUEUE_ID],
inputKey: 'INPUT',
- apiBaseUrl: 'https://api.apify.com/v2',
+ apiBaseUrl: 'https://api.apify.com',
proxyStatusUrl: 'http://proxy.apify.com',
proxyHostname: LOCAL_ENV_VARS[ENV_VARS.PROXY_HOSTNAME],
proxyPort: +LOCAL_ENV_VARS[ENV_VARS.PROXY_PORT],
diff --git a/src/storages/key_value_store.js b/src/storages/key_value_store.js
index fc4acd739..f5e853cf0 100644
--- a/src/storages/key_value_store.js
+++ b/src/storages/key_value_store.js
@@ -266,7 +266,7 @@ export class KeyValueStore {
* @return {string}
*/
getPublicUrl(key) {
- return `${this.config.get('apiBaseUrl')}/key-value-stores/${this.id}/records/${key}`;
+ return `${this.config.get('apiBaseUrl')}/v2/key-value-stores/${this.id}/records/${key}`;
}
/**