Website to Text is a simple tool for converting a website to text. It returns the text extracted from the website. To use this API, you need an API key. You can get one by creating a free account and visiting your dashboard.
Important: Ensure that this API is enabled from within your dashboard to use it in your application. If not, you may receive a 403
error
Convert a given webiste content to simple text
This is a required header
on every request. Your API Key is found from within your dashboard
This is an optional header
. Set the value to application/json
, application/xml
, or application/yaml
string
(required)The URL of the website to convert to text
Sample Request
import requests
url = "https://api.apiverve.com/v1/websitetotext"
payload = { "url": "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts" }
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.apiverve.com/v1/websitetotext"),
Headers =
{
{ "x-api-key", "YOUR_API_KEY" }
},
Content = new StringContent("{ \"url\": \"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts\" }")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
const data = JSON.stringify({ "url": "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts" });
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', 'https://api.apiverve.com/v1/websitetotext');
xhr.setRequestHeader('x-api-key', 'YOUR_API_KEY');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('Accept', 'application/json');
xhr.send(data);
const request = require('request');
const options = {
method: 'POST',
url: 'https://api.apiverve.com/v1/websitetotext',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
Accept: 'application/json'
},
body: { "url": "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts" },
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apiverve.com/v1/websitetotext"))
.header("x-api-key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{ \"url\": \"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts\" }"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
import Foundation
let headers = [
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
]
let parameters = ["url" : "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts",] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api.apiverve.com/v1/websitetotext")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
curl --request POST \
--url https://api.apiverve.com/v1/websitetotext \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '{ "url": "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts" }'
Sample Response
{
"status": "ok",
"error": null,
"data": {
"date": null,
"description": "Use Amazon EC2 for scalable computing capacity in the AWS Cloud so you can develop and deploy applications without hardware constraints.",
"title": "What is Amazon EC2?",
"title_alt": "What is Amazon EC2?",
"text": "Amazon Elastic Compute Cloud (Amazon EC2) provides on-demand, scalable computing capacity in the Amazon Web \t\tServices (AWS) Cloud. Using Amazon EC2 reduces hardware costs so you can develop and deploy \t\tapplications faster. You can use Amazon EC2 to launch as many or as few virtual servers as you \t\tneed, configure security and networking, and manage storage. You can add capacity (scale up) \t\tto handle compute-heavy tasks, such as monthly or yearly processes, or spikes in website \t\ttraffic. When usage decreases, you can reduce capacity (scale down) again. An EC2 instance is a virtual server in the AWS Cloud. When you launch an EC2 instance, \tthe instance type that you specify determines the hardware available to your instance. \tEach instance type offers a different balance of compute, memory, network, and storage \tresources. For more information, see the Amazon EC2 Instance Types Guide. Amazon EC2 provides the following high-level features: Amazon EC2 supports the processing, storage, and transmission of credit card data by a merchant or service provider, and has been validated as being compliant with Payment Card Industry (PCI) Data Security Standard (DSS). For more information about PCI DSS, including how to request a copy of the AWS PCI Compliance Package, see PCI DSS Level 1. You can create and manage your Amazon EC2 instances using the following interfaces: Amazon EC2 provides the following pricing options: For a complete list of charges and prices for Amazon EC2 and more information about the purchase \t\t\tmodels, see Amazon EC2 pricing. To create estimates for your AWS use cases, use the AWS Pricing Calculator. To estimate the cost of transforming Microsoft workloads to a modern architecture that uses open source and \t\t\t\tcloud-native services deployed on AWS, use the AWS Modernization Calculator for Microsoft Workloads. To see your bill, go to the Billing and Cost Management Dashboard in the AWS Billing and Cost Management console. Your bill contains links to usage reports that provide details \t\t\t\tabout your bill. To learn more about AWS account billing, see AWS Billing and Cost Management User Guide. If you have questions concerning AWS billing, accounts, and events, contact AWS Support. To calculate the cost of a sample provisioned \t\t\t\t\tenvironment, see . When calculating the cost of a provisioned \t\t\t\tenvironment, remember to include incidental costs such as snapshot storage for EBS \t\t\t\tvolumes. You can optimize the cost, security, and performance of your AWS environment \t\t\t\tusing AWS Trusted Advisor. You can use AWS Cost Explorer to analyze the cost and usage of your EC2 instances. You can view \t\t\t\tdata up to the last 13 months, and forecast how much you are likely to spend for the next \t\t\t\t12 months. For more information, see \t\t\t\tAnalyzing your costs with AWS Cost Explorer in the AWS Cost Management User Guide.",
"language": "en",
"publisher": null,
"url": "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts"
},
"code": 200
}
<Root>
<status>ok</status>
<error />
<data>
<date />
<description>Use Amazon EC2 for scalable computing capacity in the AWS Cloud so you can develop and deploy applications without hardware constraints.</description>
<title>What is Amazon EC2?</title>
<title_alt>What is Amazon EC2?</title_alt>
<text>Amazon Elastic Compute Cloud (Amazon EC2) provides on-demand, scalable computing capacity in the Amazon Web Services (AWS) Cloud. Using Amazon EC2 reduces hardware costs so you can develop and deploy applications faster. You can use Amazon EC2 to launch as many or as few virtual servers as you need, configure security and networking, and manage storage. You can add capacity (scale up) to handle compute-heavy tasks, such as monthly or yearly processes, or spikes in website traffic. When usage decreases, you can reduce capacity (scale down) again. An EC2 instance is a virtual server in the AWS Cloud. When you launch an EC2 instance, the instance type that you specify determines the hardware available to your instance. Each instance type offers a different balance of compute, memory, network, and storage resources. For more information, see the Amazon EC2 Instance Types Guide. Amazon EC2 provides the following high-level features: Amazon EC2 supports the processing, storage, and transmission of credit card data by a merchant or service provider, and has been validated as being compliant with Payment Card Industry (PCI) Data Security Standard (DSS). For more information about PCI DSS, including how to request a copy of the AWS PCI Compliance Package, see PCI DSS Level 1. You can create and manage your Amazon EC2 instances using the following interfaces: Amazon EC2 provides the following pricing options: For a complete list of charges and prices for Amazon EC2 and more information about the purchase models, see Amazon EC2 pricing. To create estimates for your AWS use cases, use the AWS Pricing Calculator. To estimate the cost of transforming Microsoft workloads to a modern architecture that uses open source and cloud-native services deployed on AWS, use the AWS Modernization Calculator for Microsoft Workloads. To see your bill, go to the Billing and Cost Management Dashboard in the AWS Billing and Cost Management console. Your bill contains links to usage reports that provide details about your bill. To learn more about AWS account billing, see AWS Billing and Cost Management User Guide. If you have questions concerning AWS billing, accounts, and events, contact AWS Support. To calculate the cost of a sample provisioned environment, see . When calculating the cost of a provisioned environment, remember to include incidental costs such as snapshot storage for EBS volumes. You can optimize the cost, security, and performance of your AWS environment using AWS Trusted Advisor. You can use AWS Cost Explorer to analyze the cost and usage of your EC2 instances. You can view data up to the last 13 months, and forecast how much you are likely to spend for the next 12 months. For more information, see Analyzing your costs with AWS Cost Explorer in the AWS Cost Management User Guide.</text>
<language>en</language>
<publisher />
<url>https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts</url>
</data>
<code>200</code>
</Root>
status: ok
error:
data:
date:
description: Use Amazon EC2 for scalable computing capacity in the AWS Cloud so you can develop and deploy applications without hardware constraints.
title: What is Amazon EC2?
title_alt: What is Amazon EC2?
text: 'Amazon Elastic Compute Cloud (Amazon EC2) provides on-demand, scalable computing capacity in the Amazon Web Services (AWS) Cloud. Using Amazon EC2 reduces hardware costs so you can develop and deploy applications faster. You can use Amazon EC2 to launch as many or as few virtual servers as you need, configure security and networking, and manage storage. You can add capacity (scale up) to handle compute-heavy tasks, such as monthly or yearly processes, or spikes in website traffic. When usage decreases, you can reduce capacity (scale down) again. An EC2 instance is a virtual server in the AWS Cloud. When you launch an EC2 instance, the instance type that you specify determines the hardware available to your instance. Each instance type offers a different balance of compute, memory, network, and storage resources. For more information, see the Amazon EC2 Instance Types Guide. Amazon EC2 provides the following high-level features: Amazon EC2 supports the processing, storage, and transmission of credit card data by a merchant or service provider, and has been validated as being compliant with Payment Card Industry (PCI) Data Security Standard (DSS). For more information about PCI DSS, including how to request a copy of the AWS PCI Compliance Package, see PCI DSS Level 1. You can create and manage your Amazon EC2 instances using the following interfaces: Amazon EC2 provides the following pricing options: For a complete list of charges and prices for Amazon EC2 and more information about the purchase models, see Amazon EC2 pricing. To create estimates for your AWS use cases, use the AWS Pricing Calculator. To estimate the cost of transforming Microsoft workloads to a modern architecture that uses open source and cloud-native services deployed on AWS, use the AWS Modernization Calculator for Microsoft Workloads. To see your bill, go to the Billing and Cost Management Dashboard in the AWS Billing and Cost Management console. Your bill contains links to usage reports that provide details about your bill. To learn more about AWS account billing, see AWS Billing and Cost Management User Guide. If you have questions concerning AWS billing, accounts, and events, contact AWS Support. To calculate the cost of a sample provisioned environment, see . When calculating the cost of a provisioned environment, remember to include incidental costs such as snapshot storage for EBS volumes. You can optimize the cost, security, and performance of your AWS environment using AWS Trusted Advisor. You can use AWS Cost Explorer to analyze the cost and usage of your EC2 instances. You can view data up to the last 13 months, and forecast how much you are likely to spend for the next 12 months. For more information, see Analyzing your costs with AWS Cost Explorer in the AWS Cost Management User Guide.'
language: en
publisher:
url: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts
code: 200
The Website to Text API supports the following response content types:
application/json
, application/xml
, application/yaml
You can specify the response content type by setting the Accept
header in your request. If you don't specify a content type, the API will default to application/json
.
The Website to Text API uses an API Key to authenticate requests. You can view and manage your API key by visiting your dashboard.
Your API keys carry many privileges. To keep them from being abused, please do not share the keys on client-side code or Github etc. Keep them very secure.
To use any API, you must have it enabled from within your dashboard. Disabled APIs will fail to respond to your requests.
All requests made to the API must contain the header x-api-key
in each of your requests. API requests without authentication will fail.
All API requests must also be made over secure HTTPS
. Requests made over plain HTTP
will fail.
Error Code | Meaning |
---|---|
401 | Your request was made with invalid credentials. This error also appears when you don't pass the x-api-key header in your request.
|
403 | Typically, this occurs when you are trying to access an API that you have not enabled. |
{
"status": "error",
"data": null,
"error": "tokens have been depleted",
"code": 429
}
Each subscription has its own monthly token limit. Your token count is based on your subscription plan. If you reach your limits, don't worry. You can always upgrade or downgrade at any time.
When you reach your limit, the service will stop responding and typically return an HTTP 429
response status code. The error will also contain a detailed JSON.
The Website to Text API uses the following error code:
Error Code | Meaning |
---|---|
429 | You have exceeded your rate limit and further requests will be denied until the next cycle. |
For reference, the Website to Text API uses the following error codes:
Error Code | Meaning |
---|---|
Code | Message |
200 | The request was successful. The response will include the requested data. |
400 | The request was invalid. The response will include a message that explains the error. |
401 | The request was not authorized. Usually, this means that the API key is missing or invalid. |
403 | This means that the request was trying to access a resource that it does not have permission to access. |
404 | This means that the resource you are trying to access does not exist. |
429 | This means that you have reached the rate limit. The response will include a Retry-After header that indicates how many seconds you need to wait before making a new request. |
500 | This means that there was an error on the server side. We are alerted when this happens and we will work to fix it as soon as possible. |