From e3524a10a768da6206f4573ecaad78dc4d63fb01 Mon Sep 17 00:00:00 2001 From: unclecode Date: Fri, 17 May 2024 23:28:29 +0800 Subject: [PATCH] chore: Update REST API base URL in README.md --- README.md | 4 ++-- pages/app.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9acd2405..de956f5c 100644 --- a/README.md +++ b/README.md @@ -160,11 +160,11 @@ For more information about how to run Crawl4AI as a local server, please refer t ## Using the Local server ot REST API 🌐 -You can also use Crawl4AI through the REST API. This method allows you to send HTTP requests to the Crawl4AI server and receive structured data in response. The base URL for the API is `https://crawl4ai.com/crawl`. If you run the local server, you can use `http://localhost:8000/crawl`. (Port is dependent on your docker configuration) +You can also use Crawl4AI through the REST API. This method allows you to send HTTP requests to the Crawl4AI server and receive structured data in response. The base URL for the API is `https://crawl4ai.com/crawl` [COMING SOON]. If you run the local server, you can use `http://localhost:8000/crawl`. (Port is dependent on your docker configuration) ### Example Usage -To use the REST API, send a POST request to `https://crawl4ai.com/crawl` with the following parameters in the request body. +To use the REST API, send a POST request to `http://localhost:8000/crawl` with the following parameters in the request body. **Example Request:** ```json diff --git a/pages/app.js b/pages/app.js index 200e29d3..a82538c0 100644 --- a/pages/app.js +++ b/pages/app.js @@ -136,13 +136,13 @@ document.getElementById("crawl-btn").addEventListener("click", () => { ).textContent = `curl -X POST -H "Content-Type: application/json" -d '${JSON.stringify({ ...data, api_token: isLLMExtraction ? "your_api_token" : undefined, - }, null, 2)}' http://crawl4ai.com/crawl`; + }, null, 2)}' http://localhost:8000/crawl`; document.getElementById("python-code").textContent = `import requests\n\ndata = ${JSON.stringify( { ...data, api_token: isLLMExtraction ? "your_api_token" : undefined }, null, 2 - )}\n\nresponse = requests.post("http://crawl4ai.com/crawl", json=data) # OR local host if your run locally \nprint(response.json())`; + )}\n\nresponse = requests.post("http://localhost:8000/crawl", json=data) # OR local host if your run locally \nprint(response.json())`; document.getElementById( "nodejs-code" @@ -150,7 +150,7 @@ document.getElementById("crawl-btn").addEventListener("click", () => { { ...data, api_token: isLLMExtraction ? "your_api_token" : undefined }, null, 2 - )};\n\naxios.post("http://crawl4ai.com/crawl", data) // OR local host if your run locally \n .then(response => console.log(response.data))\n .catch(error => console.error(error));`; + )};\n\naxios.post("http://localhost:8000/crawl", data) // OR local host if your run locally \n .then(response => console.log(response.data))\n .catch(error => console.error(error));`; document.getElementById( "library-code"