The AI web scraper is available via a single API endpoint. We refer to this as the 'Retrieve' endpoint, as it is used for retrieving data from any web page and returning structured data exactly how we described it.
Endpoint URL:
https://instantapi.ai/api/retrieve/
The Retrieve endpoint accepts several parameters within the JSON body payload. Below is a detailed description of each parameter, including whether it's required, its purpose, type, and example usage.
import requests import json url = "https://instantapi.ai/api/retrieve/" headers = { "Content-Type": "application/json" } data = { "webpage_url": "https://www.ebay.com/itm/175955440726", "api_method_name": "getItemDetails", "api_response_structure": json.dumps({ "item_name": "<the item name>", "item_price": "<the item price>", "item_image": "<the absolute URL of the first item image>", "item_url": "<the absolute URL of the item>", "item_type": "<the item type>", "item_weight": "<the item weight>", "item_main_feature": "<the main feature of this item that would most appeal to its target audience>", "item_review_summary": "<a summary of the customer reviews received for this item>", "item_available_colors": "<the available colors of the item, converted to closest primary colors>", "item_materials": "<the materials used in the item>", "item_shape": "<the shape of the item>" }), "api_key": "<your API key>" } response = requests.post(url, headers=headers, json=data) print(response.json())
import requests import json url = "https://instantapi.ai/api/retrieve/" headers = { "Content-Type": "application/json" } data = { "webpage_url": "https://tehrantimes.com/", "api_method_name": "getAllNewsArticleURLs", "api_response_structure": json.dumps({ "all_news_article_urls": [ { "news_article_url": "<the absolute URL of the news article>" } ] }), "link_extract": True, "api_key": "<your API key>" } response = requests.post(url, headers=headers, json=data) print(response.json())
{ "response": { "name": "John Doe", "email": "john.doe@example.com" }, "verbose_full_html": "<html> ... </html>", "verbose_markdown": "--- ..." }
{ "error": true, "reason": "Missing required parameters. Please check and try again with required parameters." }
Use clear and descriptive names for api_method_name to guide the AI effectively. For example, prefer getUserData over getData.
Clearly define the api_response_structure to ensure the AI understands your requirements. Specificity leads to more accurate responses.
Utilize api_parameters to provide additional context, helping the AI generate more precise outputs.
The AI model's latency is influenced by the length of the output. Be concise in your requests to improve response time.
The service defaults to the quickest scraping method. Use country-specific premium web proxies only when necessary to avoid latency.
Be creative with your output requirements. The AI can handle various tasks, including summarization and sentiment analysis.
The AI can infer information and perform analytical tasks. Specify outputs that require deeper understanding or analysis.
If required parameters are missing or an error occurs, the Retrieve endpoint will return an error message. It's recommended to retry up to five times before failing, due to potential cycling in and out of premium web proxies.
While the AI is powerful, it may not always interpret requests perfectly. Providing clear, detailed instructions will yield the best results.
The form has been successfully submitted.