### Python Example: Get Upload URL and File Key Source: https://www.silverlining.cloud/docs/aws/s3ndless A Python script demonstrating how to request an upload URL and file key from the s3ndless API using the requests library. ```python import requests import json # Step 1: Get the upload URL url = "https://d1i4ws38emn0dh.cloudfront.net/api/web/get-upload-url" headers = { 'Content-Type': 'application/json' } body = { "content_type": "image/png", "expiration_downloads": 10, "expiration_hours": 24, } response = requests.post(url, headers=headers, data=json.dumps(body)) upload_info = response.json() upload_url = upload_info["upload_url"] file_key = upload_info["file_key"] ``` -------------------------------- ### Example Forex Data Row Source: https://www.silverlining.cloud/docs/aws/forex-data Each CSV file contains end-of-day exchange rates for a specific currency against the US dollar. This example shows a single row format. ```csv 30.04.2023,0.90822 29.04.2023,0.8987 28.04.2023,0.8987 27.04.2023,0.9065 26.04.2023,0.90539 25.04.2023,0.9108 24.04.2023,0.90435 23.04.2023,0.90975 ``` -------------------------------- ### Manage VNC Server Configuration Source: https://www.silverlining.cloud/docs/aws/fedora-gui Edit the VNC server startup script to make changes. This script is automatically started on instance reboot. Use 'sudo nano' to edit the file and 'sudo reboot' to apply changes. ```bash sudo nano /etc/tigervnc/vncserver-config-defaults ``` ```bash sudo reboot ``` -------------------------------- ### Manage VNC Server Startup Script Source: https://www.silverlining.cloud/docs/aws/opensuse-gui Edit the VNC server startup script to manage VNC services or change display dimensions. This script is automatically started on VM reboot. ```bash nano /home/ec2-user/.vnc/manage-vnc.sh ``` -------------------------------- ### Fix Missing Snap Applications in GUI Source: https://www.silverlining.cloud/docs/aws/playwright-ubuntu-gui Copy .desktop files from the snap directory to the applications directory to make installed Snap applications appear in the GUI application list. ```bash sudo cp /var/lib/snapd/desktop/applications/*.desktop /usr/share/applications/ ``` -------------------------------- ### Navigate to Puppeteer Directory Source: https://www.silverlining.cloud/docs/aws/puppeteer-ubuntu Change the current directory to the Puppeteer installation folder on the Ubuntu VM. This is where your scripts are located. ```bash cd /home/ubuntu/Puppeteer ``` -------------------------------- ### Run Edge Tests on Selenium Grid Source: https://www.silverlining.cloud/docs/aws/selenium-dynamic-grid Connect to a Selenium Grid instance and execute Edge browser tests. Ensure Selenium libraries are installed locally. ```python from selenium import webdriver options = webdriver.EdgeOptions() # Instantiate the WebDriver driver = webdriver.Remote( command_executor='http://:4444/wd/hub', options=options ) driver.get("https://www.whatismybrowser.com") driver.save_screenshot('screenshot.png') driver.quit() ``` -------------------------------- ### Run Chrome Tests on Selenium Grid Source: https://www.silverlining.cloud/docs/aws/selenium-dynamic-grid Connect to a Selenium Grid instance and execute Chrome browser tests. Ensure Selenium libraries are installed locally. ```python from selenium import webdriver from selenium.webdriver.chrome.options import Options as ChromeOptions options = ChromeOptions() # Instantiate the WebDriver driver = webdriver.Remote( command_executor='http://:4444/wd/hub', options=options ) driver.get("https://www.whatismybrowser.com") driver.save_screenshot('screenshot.png') driver.quit() ``` -------------------------------- ### Run Firefox Tests on Selenium Grid Source: https://www.silverlining.cloud/docs/aws/selenium-dynamic-grid Connect to a Selenium Grid instance and execute Firefox browser tests. Ensure Selenium libraries are installed locally. ```python from selenium import webdriver from selenium.webdriver.firefox.options import Options as FirefoxOptions options = FirefoxOptions() # Instantiate the WebDriver driver = webdriver.Remote( command_executor='http://:4444/wd/hub', options=options ) driver.get("https://www.whatismybrowser.com") driver.save_screenshot('screenshot.png') driver.quit() ``` -------------------------------- ### Main Upload Execution Flow (Node.js) Source: https://www.silverlining.cloud/docs/aws/s3ndless Orchestrates the file upload process by first getting the upload URL and then uploading the file. Includes error handling for the entire process. ```javascript // Main function (async () => { try { const filePath = "/Users/michael/Downloads/Diagram S3ndless with planes.png"; // change this const { upload_url, file_key } = await getUploadUrl(); const status = await uploadFile(upload_url, filePath); if (status === 200) { console.log(`Upload successful! File key: ${file_key}`); } else { console.log(`Upload failed: HTTP ${status}`); } } catch (err) { console.error('Error:', err.response?.data || err.message); } })(); ``` -------------------------------- ### Start Background Session with tmux Source: https://www.silverlining.cloud/docs/aws/puppeteer-ubuntu Initiate a new tmux session to run scripts in the background. This allows scripts to continue running even after the SSH session is closed. ```bash tmux ``` -------------------------------- ### Configure GUI Startup Script Source: https://www.silverlining.cloud/docs/aws/amazonlinux2023-gui Modify the VNC server startup script for Amazon Linux 2023. This script is automatically executed on instance reboot. Use nano to edit the configuration file. ```bash sudo nano /etc/tigervnc/vncserver-config-defaults ``` -------------------------------- ### Run NodeJS Sample Code Source: https://www.silverlining.cloud/docs/aws/playwright-windows Execute the sample NodeJS script using Visual Studio Code on the Windows instance. Note that the first execution might be slow. ```javascript console.log("Hello World!"); ``` -------------------------------- ### GET RESULTS API Endpoint Details Source: https://www.silverlining.cloud/docs/aws/ocr Details for the GET RESULTS API endpoint, including URL, method, required headers, and body parameters. ```json URL endpoint: https://aws-ocr.silverlining.cloud/get-results Method: POST "header": { "x-api-key": STRING, "Content-Type": "application/json" } "body": { "job_id": STRING } ``` -------------------------------- ### Edit GUI Startup Script Source: https://www.silverlining.cloud/docs/aws/debian-gui Use nano to edit the script that launches the GUI on every reboot. This script is located at /home/start-gui.sh. ```bash nano /home/start-gui.sh ``` -------------------------------- ### Get Historical Rates Source: https://www.silverlining.cloud/docs/aws/forex-api Retrieves the end-of-day historical exchange rate for a specified date and currency pair. ```APIDOC ## POST /historical-rates ### Description Retrieves the end-of-day historical exchange rate for a specified date and currency pair. ### Method POST ### Endpoint https://forex-aws.silverlining.cloud/historical-rates ### Headers - **x-api-key** (STRING) - Required - **Content-Type** (STRING) - Required - application/json ### Request Body - **base** (STRING) - Required - The base currency for which the rate is sought. Must be the currency code. - **target** (STRING) - Required - The target currency for which the rate is to be fetched. Must be the currency code. - **date** (DATE) - Required - The date of the historical exchange rate. Must be in "YYYY-MM-DD" format. ### Response #### Success Response (200) - **base_code** (STRING) - The provided base currency code. - **base_name** (STRING) - The English name of the provided base currency. - **target_code** (STRING) - The provided target currency code. - **target_name** (STRING) - The English name of the provided target currency. - **rate** (NUMBER) - The end-of-day exchange rate for the provided date and specified currency pair. - **date** (DATE) - The supplied date for which the exchange rate was required. #### Response Example { "base_code": "USD", "base_name": "United States Dollar", "target_code": "EUR", "target_name": "Euro", "rate": 0.91, "date": "2023-01-31" } ``` -------------------------------- ### Create New GUI User Source: https://www.silverlining.cloud/docs/aws/debian-gui Add a new user for the GUI session using the 'adduser' command. This user will be used for GUI logins. ```bash sudo adduser guiuser ``` -------------------------------- ### POST /static/create Source: https://www.silverlining.cloud/docs/aws/qrcode Creates a QR code based on the provided content and customization options. The QR code can be returned as a file or a URL. ```APIDOC ## POST /static/create ### Description Creates a QR code based on the provided content and customization options. The QR code can be returned as a file or a URL. ### Method POST ### Endpoint https://qrcode-aws.silverlining.cloud/static/create ### Headers - **x-api-key** (STRING) - Required - **Content-Type** (STRING) - Required - application/json ### Request Body - **content** (STRING) - Required - The content to be represented in the QR code. - **background_color** (STRING) - Optional - The background color of the QR code in RGB hex format, preceded by a # (e.g., #4D4D4E). Default is white. - **fill_color** (STRING) - Optional - The color of the QR code tiles in RGB hex format, preceded by a # (e.g., #EDEDED). Default is black. - **image_url** (STRING) - Optional - A link to a publicly available image that will be placed at the center of the QR code. - **error_correction** (STRING) - Optional - Defines the error correction capability of the QR code. Acceptable values are "Low", "Medium", "Quartile", and "High". The default value is "Low". - **border** (NUMBER) - Optional - Specifies the width of the QR code's border. Default value is 4. - **box_size** (NUMBER) - Optional - Determines the size of each individual box within the QR code grid. Default value is 10. - **return_as_file** (BOOLEAN) - Optional - When set to `true`, the API will return the QR Code as a downloadable image file. If set to `false` (or not specified), the API will return a URL pointing to the image of the QR Code. ### Response #### Success Response (200) - **qrcode_url** (STRING) - The link to the created QR code, available for download. - **metadata** (OBJECT) - Contains metadata about the generated QR code. - **content** (STRING) - The content represented on the QR code. - **background_color** (STRING) - The background color used for the QR code. - **fill_color** (STRING) - The tile color used for the QR code. - **logo_url** (STRING) - The link to the used image. Returns **None** if not present. - **error_correction** (STRING) - The error correction method used. - **border** (NUMBER) - Width of the border in pixels. - **box_size** (NUMBER) - Size of each individual box in the grid in pixels. - **return_as_file** (BOOLEAN) - Indicates if the QR code was returned as a file. #### Response Example { "qrcode_url": "https://qrcode-aws.silverlining.cloud/qrcodes/example.png", "metadata": { "content": "https://example.com", "background_color": "#FFFFFF", "fill_color": "#000000", "logo_url": null, "error_correction": "Low", "border": 4, "box_size": 10, "return_as_file": false } } ``` -------------------------------- ### Get Current Exchange Rates Source: https://www.silverlining.cloud/docs/aws/forex-api Fetches the latest exchange rates for a specified base currency. Requires an API key for authentication. ```APIDOC ## POST /rates ### Description Fetches the latest exchange rates for a specified base currency. Requires an API key for authentication. ### Method POST ### Endpoint https://forex-aws.silverlining.cloud/rates ### Parameters #### Header Parameters - **x-api-key** (STRING) - Required - Your unique API key for authentication. - **Content-Type** (STRING) - Required - Must be application/json. #### Request Body - **base** (STRING) - Required - The base currency for calculating exchange rates (e.g., USD, EUR). See the list of available currencies. ### Response #### Success Response (200) - **base_code** (STRING) - The provided currency code. - **base_name** (STRING) - The English name of the provided currency. - **base_amount** (NUMBER) - Always returns 1. - **last_updated** (DATETIME) - The date and time when the currency rates were last updated. - **rates** (ARRAY) - A list of objects, where each object contains: - **code** (STRING) - The currency code. - **name** (STRING) - The English name of the currency. - **rate** (NUMBER) - The exchange rate relative to the provided base currency. ### Response Example ```json { "base_code": "USD", "base_name": "United States Dollar", "base_amount": 1, "last_updated": "2023-10-27T10:00:00Z", "rates": [ { "code": "EUR", "name": "Euro", "rate": 0.95 }, { "code": "JPY", "name": "Japanese Yen", "rate": 150.00 } ] } ``` ``` -------------------------------- ### Navigate to Selenium Directory Source: https://www.silverlining.cloud/docs/aws/selenium-ubuntu Change the current directory to the Selenium Python scripts location on the Ubuntu VM. ```bash cd /home/ubuntu/Selenium/Python ``` -------------------------------- ### Email Validation API Response Structure Source: https://www.silverlining.cloud/docs/aws/validation-api Example response body structure for the email-address validation endpoint, detailing the fields and their possible values. ```json "body": { "validationResult": { "provided_email_address": STRING, "status": STRING, "is_disposable_email": BOOLEAN, "is_free_provider": BOOLEAN, "is_function_role_email": BOOLEAN } } ``` -------------------------------- ### Get S3 Upload URL (Node.js) Source: https://www.silverlining.cloud/docs/aws/s3ndless Fetches a presigned upload URL from the S3ndless API. Requires specifying content type and expiration settings. ```javascript const axios = require('axios'); const fs = require('fs'); const path = require('path'); // Step 1: Get the upload URL async function getUploadUrl() { const url = "https://d1i4ws38emn0dh.cloudfront.net/api/web/get-upload-url"; const headers = { 'Content-Type': 'application/json', }; const body = { content_type: 'image/png', expiration_downloads: 10, expiration_hours: 24, }; const response = await axios.post(url, body, { headers }); return response.data; } ``` -------------------------------- ### Connect to VM via SSH Source: https://www.silverlining.cloud/docs/aws/chrome-remote-headless Connects to a virtual machine instance using SSH with a specified key file. Ensure the key file has the correct permissions and the public IP address is accurate. ```bash ssh -i ubuntu@ ``` -------------------------------- ### Build Docker Image Source: https://www.silverlining.cloud/docs/aws/selenium-lambda Build the preconfigured Docker image for the Selenium Python application. The '.' indicates the current directory as the build context. ```bash docker build -t selenium-docker-python . ``` -------------------------------- ### Get Upload URL Source: https://www.silverlining.cloud/docs/aws/s3ndless Creates a temporary upload link (pre-signed URL) for uploading a file to S3. This is the first step in the file upload process. ```APIDOC ## POST /api/web/get-upload-url ### Description Creates a temporary upload link (pre-signed URL) so you can upload a file to S3. ### Method POST ### Endpoint https:///api/web/get-upload-url ### Headers - **Content-Type**: application/json - **X-Allowed-Via**: s3ndless-cloudfront-secret ### Request Body - **content_type** (STRING) - Required - MIME type of the file (e.g. image/png) - **expiration_downloads** (NUMBER) - Required - Max number of times the file can be downloaded - **expiration_hours** (NUMBER) - Required - How long (in hours) the file is available - **password_hash** (STRING) - Optional - SHA256 hash of the download password (if needed) - **salt** (STRING) - Optional - Salt used to hash the password - **upload_password** (STRING) - Optional - Needed if uploads are protected with a password ### Response #### Success Response - **upload_url** (STRING) - Use this to upload your file. - **file_key** (STRING) - Internal key to identify files, needed for downloads. ### Request Example ```json { "content_type": "image/png", "expiration_downloads": 10, "expiration_hours": 24 } ``` ### Response Example ```json { "upload_url": "STRING", "file_key": "STRING" } ``` ``` -------------------------------- ### Get Upload URL API Response Details Source: https://www.silverlining.cloud/docs/aws/s3ndless The response from the get-upload-url API, providing the pre-signed upload URL and a file key for subsequent operations. ```json { "upload_url": STRING, "file_key": STRING } ``` -------------------------------- ### Navigate to Project Directory Source: https://www.silverlining.cloud/docs/aws/selenium-lambda Change the current directory to the selenium-docker-python project folder. This is necessary before building the Docker image. ```bash cd selenium-docker-python ``` -------------------------------- ### Get Historical Exchange Rates Source: https://www.silverlining.cloud/docs/aws/forex-api Retrieves historical exchange rates for a specific date between a base and target currency. Requires an API key for authentication. ```APIDOC ## POST /historical-rates ### Description Retrieves historical exchange rates for a specific date between a base and target currency. Requires an API key for authentication. ### Method POST ### Endpoint https://forex-aws.silverlining.cloud/historical-rates ### Parameters #### Header Parameters - **x-api-key** (STRING) - Required - Your unique API key for authentication. - **Content-Type** (STRING) - Required - Must be application/json. #### Request Body - **base** (STRING) - Required - The base currency for calculating exchange rates (e.g., USD). - **target** (STRING) - Required - The target currency for calculating exchange rates (e.g., EUR). - **date** (STRING) - Required - The date for which to retrieve historical rates in YYYY-MM-DD format (e.g., 2020-10-01). ### Response #### Success Response (200) - **base_code** (STRING) - The provided base currency code. - **target_code** (STRING) - The provided target currency code. - **date** (STRING) - The requested date for the historical rate. - **rate** (NUMBER) - The exchange rate between the base and target currency on the specified date. ### Response Example ```json { "base_code": "USD", "target_code": "EUR", "date": "2020-10-01", "rate": 0.85 } ``` ``` -------------------------------- ### Navigate to Playwright Node.js Directory Source: https://www.silverlining.cloud/docs/aws/playwright-ubuntu Change the current directory to the Playwright Node.js sample code location on the VM. ```bash cd /home/ubuntu/Playwright/NodeJS ``` -------------------------------- ### Call /rates Endpoint Source: https://www.silverlining.cloud/docs/aws/forex-api This C# snippet demonstrates how to call the /rates endpoint to get exchange rates. Ensure you replace with your actual API key. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://forex-aws.silverlining.cloud/rates"); request.Headers.Add("x-api-key", ""); var content = new StringContent("{\n \"base\": \"USD\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get OCR Results Source: https://www.silverlining.cloud/docs/aws/ocr Retrieves the OCR processing results for a given job ID. This endpoint is used to fetch the status and output URLs of an OCR job. ```APIDOC ## POST /get-results ### Description Retrieves the OCR processing results for a given job ID. This endpoint is used to fetch the status and output URLs of an OCR job. ### Method POST ### Endpoint https://aws-ocr.silverlining.cloud/get-results ### Parameters #### Header Parameters - **x-api-key** (STRING) - Required - API key for authentication. - **Content-Type** (STRING) - Required - Must be set to "application/json". #### Request Body - **job_id** (STRING) - Required - Unique, string-based identifier generated automatically when a document is first submitted to the OCR API. It serves as the primary key for tracking your document throughout the asynchronous processing pipeline. ### Response #### Success Response (200) - **status** (STRING) - The current lifecycle state of the request (e.g., started, completed, failed). - **ocr_results_url** (STRING) - The permanent Azure Blob link to the normalized JSON output (formatted for easy parsing). - **ocr_results_url_raw** (STRING) - The permanent Azure Blob link to the raw PaddleOCR output (includes all engine-level data). #### Response Example { "status": "completed", "ocr_results_url": "https://example.com/path/to/normalized_results.json", "ocr_results_url_raw": "https://example.com/path/to/raw_results.json" } ``` -------------------------------- ### Get IP Geolocation (C#) Source: https://www.silverlining.cloud/docs/aws/geolocation Retrieves country, state, city, and coordinates for a given IP address using the /get-location endpoint. Requires an API key. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://ip-aws.silverlining.cloud/get-location"); request.Headers.Add("x-api-key", ""); var content = new StringContent("{\n \"ip_address\": \"143.50.237.65\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Build Docker Image Source: https://www.silverlining.cloud/docs/aws/playwright-lambda Build the preconfigured Docker image for Playwright on Node.js. ```bash docker build -t playwright-docker-nodejs . ``` -------------------------------- ### Connect to openSUSE VM via SSH Source: https://www.silverlining.cloud/docs/aws/opensuse-gui Use this command to connect to your openSUSE virtual machine using SSH. Ensure you have your .pem key file and the instance's public IP address. ```bash ssh -i ec2-user@ ``` -------------------------------- ### Create Dynamic QR Code Source: https://www.silverlining.cloud/docs/aws/qrcode This C# snippet demonstrates how to create a dynamic QR code pointing to a specific URL. It allows customization of background and fill colors, and inclusion of a logo. The destination URL can be changed without altering the QR code image, and scan tracking is supported. ```csharp var client = new RestClient("https://qrcode-aws.silverlining.cloud/dynamic/create"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("x-api-key", ""); request.AddHeader("Content-Type", "application/json"); var body = @"{{ "content": "https://www.silverlining.cloud/docs/aws/qrcode", "background_color": "#4D4D4E", "fill_color": "#FFFFFF", "image_url": "https://s3.amazonaws.com/cdn.silverlining.cloud/Square_Dark-CLOUD3-white-background.png" }}"; request.AddParameter("application/json", body, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); ``` -------------------------------- ### Agentic Scraper API Demo Playground Instructions Source: https://www.silverlining.cloud/docs/aws/agentic-scraper This message indicates that a request needs to be sent to the API to see the results from the demo playground. The playground allows real-time testing by entering a URL and a natural language instruction. ```text "To see the result, please send a request to the API." ``` -------------------------------- ### Connect to VM via SSH Source: https://www.silverlining.cloud/docs/aws/playwright-lambda Connect to your virtual machine using SSH with the ec2-user and a private key file. ```bash ssh -i keyfile.pem ec2-user@public-ip ``` -------------------------------- ### Run Sample JavaScript Script with Puppeteer Source: https://www.silverlining.cloud/docs/aws/puppeteer-windows This snippet shows how to execute a JavaScript file using Node.js and Puppeteer within a Windows environment. Ensure Visual Studio Code is set up for debugging Node.js applications. ```javascript function example() { return true; } ``` -------------------------------- ### Get Upload URL API Request Details Source: https://www.silverlining.cloud/docs/aws/s3ndless Details for making a POST request to the get-upload-url API endpoint. Includes required and optional body parameters for file upload configuration. ```json { "content_type": STRING, "expiration_downloads": NUMBER, "expiration_hours": NUMBER, "password_hash": STRING, "salt": STRING, "upload_password": STRING } ``` -------------------------------- ### Log in to AWS ECR with Docker Source: https://www.silverlining.cloud/docs/aws/playwright-lambda Log in to your AWS account with Docker to push images to ECR. Replace with your actual AWS Account ID. ```bash aws --region us-east-1 ecr get-login-password | docker login --username AWS --password-stdin .dkr.ecr.us-east-1.amazonaws.com ``` -------------------------------- ### Run Selenium Tests Remotely with Python Source: https://www.silverlining.cloud/docs/aws/selenium-remote-ubuntu Connect to a Selenium Remote Webdriver instance using Python to run browser automation tests. Ensure Selenium libraries are installed locally. The first execution after startup can be slow. ```python from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.add_argument("--headless") driver = webdriver.Remote( command_executor="http://:4444", options=options ) driver.get("https://www.google.com") print(driver.title) driver.quit() ``` -------------------------------- ### Deploy Files to Debian VM using WinSCP Source: https://www.silverlining.cloud/docs/aws/debian-gui Deploy files to your Debian virtual machine remotely using WinSCP. This involves configuring SFTP protocol, authentication with a key file, and connecting to the instance. ```bash Choose 'SFTP' as the file protocol and enter the public IP address of your instance, using 'admin' as the username. Click on 'Advanced'. In the left-side menu, select 'Authentication'. Under Authentication parameters, select the key file you created when you launched the virtual machine. When prompted, convert the .pem key file to PuTTY format. Close the Authentication window by clicking on 'OK', and connect to the virtual machine by clicking on 'Login'. ``` -------------------------------- ### Run Selenium Sample Code (Edge) Source: https://www.silverlining.cloud/docs/aws/selenium-amazonlinux Execute the Python script for running Selenium tests with Edge. Ensure the script is in the current directory. ```python python3 sample-edge.py ``` -------------------------------- ### Create QR Code Source: https://www.silverlining.cloud/docs/aws/qrcode Creates a new QR code with specified content and customization options. The QR code can be returned as a file or a URL. ```APIDOC ## POST /dynamic/create ### Description Creates a new QR code with specified content and customization options. The QR code can be returned as a file or a URL. ### Method POST ### Endpoint https://qrcode-aws.silverlining.cloud/dynamic/create ### Headers - **x-api-key** (STRING) - Required - **Content-Type** (STRING) - Required - application/json ### Request Body - **content** (STRING) - Required - The destination URL to which the QR code should redirect the user. This must be a valid URL, including the protocol (http:// or https://). - **background_color** (STRING) - Optional - The background color of the QR code in RGB hex format, preceded by a # (e.g., #4D4D4E). Default is white. - **fill_color** (STRING) - Optional - The color of the QR code tiles in RGB hex format, preceded by a # (e.g., #EDEDED). Default is black. - **image_url** (STRING) - Optional - A link to a publicly available image that will be placed at the center of the QR code. - **error_correction** (STRING) - Optional - Defines the error correction capability of the QR code. Acceptable values are "Low", "Medium", "Quartile", and "High". The default value is "Low". - **border** (NUMBER) - Optional - Specifies the width of the QR code's border filled with the background_colour. Default value is 4. - **box_size** (NUMBER) - Optional - Determines the size of each individual box within the QR code grid, adjusting the overall QR code scale. Default value is 10. - **return_as_file** (BOOLEAN) - Optional - When set to `true`, the API will return the QR Code as a downloadable image file. If set to `false` (or not specified), the API will return a URL pointing to the image of the QR Code. ### Response #### Success Response (200) - **qrcode_url** (STRING) - The link to the created QR code, available for download. - **metadata** (OBJECT) - Contains metadata about the created QR code. - **content** (STRING) - The destination URL where the QR code redirects. - **redirection_url** (STRING) - The public URL represented on the QR code. - **key** (STRING) - A unique key associated with the QR code. - **background_color** (STRING) - The background color used for the QR code. - **fill_color** (STRING) - The tile color used for the QR code. - **logo_url** (STRING) - The link to the used image. Returns **None** if not present. - **error_correction** (STRING) - The error correction method used. - **border** (NUMBER) - Width of the border in pixels. - **box_size** (NUMBER) - Size of each individual box in the grid in pixels. - **return_as_file** (BOOLEAN) - Indicates if the QR code was returned as a file. ``` -------------------------------- ### Agentic Scraper API - Crawl Endpoint Source: https://www.silverlining.cloud/docs/aws/agentic-scraper This code sample demonstrates how to use the '/crawl' endpoint to extract specific data from a given URL. It includes an example of how to send a POST request with an API key and a JSON payload containing the URL and a natural language instruction for data extraction. ```APIDOC ## POST /crawl ### Description This endpoint allows you to scrape data from a specified URL using natural language instructions. It can extract specific information and return it in a JSON format. ### Method POST ### Endpoint `https://scraper-api.silverlining.cloud/v1/crawl` ### Parameters #### Request Body - **url** (string) - Required - The URL of the website to scrape. - **action** (string) - Required - A natural language instruction describing the data to extract. ### Request Example ```json { "url": "https://www.amazon.com/Apple-MG464LL-A-iPhone-Black/dp/B0FQFM95MD", "action": "Extract the price of the iPhone and return it as a JSON in this format: {'price': }" } ``` ### Headers - **x-api-key** (string) - Required - Your unique API key. ### Response #### Success Response (200) - The response will be a JSON object containing the extracted data as specified in the 'action' field. #### Response Example ```json { "price": "$199.00" } ``` ``` -------------------------------- ### Connect to Fedora VM via SSH Source: https://www.silverlining.cloud/docs/aws/fedora-gui Use this command to connect to your Fedora virtual machine via SSH. Ensure you have your .pem key file and the public IP address of your instance. ```bash ssh -i fedora@ ``` -------------------------------- ### Run Selenium Sample Code (Firefox) Source: https://www.silverlining.cloud/docs/aws/selenium-amazonlinux Execute the Python script for running Selenium tests with Firefox. Ensure the script is in the current directory. ```python python3 sample-firefox.py ``` -------------------------------- ### Connect to Debian VM via SSH Source: https://www.silverlining.cloud/docs/aws/debian-gui Connect to your Debian virtual machine using SSH from a terminal. Ensure you have your key file and the instance's public IP address. ```bash ssh -i admin@ ``` -------------------------------- ### Configure AWS CLI Source: https://www.silverlining.cloud/docs/aws/playwright-lambda Configure your AWS access and secret keys using the AWS CLI. ```bash aws configure ```