Everything You Need To Build A Website Scraping App
The ScrapeStack API was built to offer a simple REST API interface for scraping web pages at scale without having to programatically deal with geolocations, IP blocks or CAPTCHAs. The API supports a series of features essential to web scraping, such as JavaScript rendering, custom HTTP headers, various geo-targets, POST/PUT requests and an option to use premium residential proxies instead of datacenter proxies. In this article we will see how fast and easy it is to use RAD Studio and Delphi to create a Firemonkey multidevide application using the LowCode Wizard in addition to a REST client library to take advantage of ScrapeStack API and retrieve a JSON format response for Website Scrape in real-time. Our RAD Studio and Delphi applications will be able to call the API and request information based on the name of parameters you provide How do I set up the ScrapeStack API? Make sure you refer to ScrapeStack API website – https://ScrapeStack.com/ – and SignUp for the free Plan providing only your email and some basic information (no credit card required). Once you are in the website will redirect you to a Quickstart guide dashboard and your API Access Key will be provided. The Access Key unique, personal and is required to authenticate with the API. Keep it safe! How do I call ScrapeStack API endpoints? Now all we need to do is to call the API base URL http://api.scrapeStack.com/ via a HTTP POST method with no JSON request body needed and some few requested parameters added to the URL address depending on the endpoint we choose to call. One can do that using REST Client libraries available on several programming languages. scrapeStack offers a single endpoint to scrape whatever webpage you want. For a complete and detailed information on endpoint and its parameters make sure you refer to ScrapeStack Quickstart guide at https://scrapeStack.com/quickstart // Scrape web page by providing a URL http://api.scrapestack.com/scrape ? access_key = YOUR_ACCESS_KEY & url = https://apple.com // optional parameters: & render_js = 0 & keep_headers = 0 & proxy_location = us & premium_proxy = 0 // more parameters available please refer to the API Documentation (https://scrapeStack.com/documentation) // Scrape web page by providing a URL http://api.scrapestack.com/scrape ? access_key = YOUR_ACCESS_KEY & url = https://apple.com // optional parameters: & render_js = 0 & keep_headers = 0 & proxy_location = us & premium_proxy = 0 // more parameters available please refer to the API Documentation (https://scrapeStack.com/documentation) What does the ScrapeStack API endpoint return? After the call the main results will be the complete scrape of the website that you provided in the parameter URL. In this case we provided Embarcadero’s website https://www.embarcadero.com – part of the result is shown in the screenshot below. How do I connect my Delphi applications to ScrapeStack API? Once you have followed basic steps to set up the ScrapeStack API we need to make sure we are able to connect and communicate with it before we start writing some code. RAD Studio Delphi and C++Builder make it very easy to connect to APIs as you can you REST Debugger to automatically create the REST components and paste them into your app. In Delphi all the job is done using 3 components tot make the API call. They are the TRESTClient, TRESTRequest, and TRESTResponse. Once you connect the […]
