Documentation
Quick start
Three steps from nothing to your first page.
- Create an account on the sign-up page. Your API key is on your account page.
- Buy credits on your account's Credits page, from $5. A page costs 1 credit, or 5 credits as a browser shows it; failed requests are free.
- Send a request: the address goes in the
urlparameter, the key in theAuthorizationheader.
Your first request
cURL
curl "https://gimmepage.com/v1/fetch?url=https%3A%2F%2Fexample.com%2F" \
-H "Authorization: Bearer YOUR_API_KEY"
Python
# pip install gimmepage
from gimmepage import Gimmepage
client = Gimmepage(api_key="YOUR_API_KEY")
page = client.fetch("https://example.com/")
print(page.site_status, page.cost, page.balance)
print(page.text)
JavaScript
// npm install gimmepage
import { Gimmepage } from "gimmepage";
const client = new Gimmepage({ apiKey: "YOUR_API_KEY" });
const page = await client.fetch("https://example.com/");
console.log(page.siteStatus, page.cost, page.balance);
console.log(page.text);
PHP
<?php
$query = http_build_query(['url' => 'https://example.com/']);
$ch = curl_init('https://gimmepage.com/v1/fetch?' . $query);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_API_KEY']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $body;
Go
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
q := url.Values{}
q.Set("url", "https://example.com/")
req, _ := http.NewRequest("GET", "https://gimmepage.com/v1/fetch?"+q.Encode(), nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Header.Get("Gimmepage-Cost"), string(body))
}
Ruby
require "net/http"
require "uri"
uri = URI("https://gimmepage.com/v1/fetch")
uri.query = URI.encode_www_form(url: "https://example.com/")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer YOUR_API_KEY"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |h| h.request(req) }
puts res["Gimmepage-Cost"], res.body
Java
import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create("https://gimmepage.com/v1/fetch?url=https%3A%2F%2Fexample.com%2F"))
.header("Authorization", "Bearer YOUR_API_KEY")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.headers().firstValue("Gimmepage-Cost").orElse("") + " " + response.body());
C#
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
var response = await http.GetAsync("https://gimmepage.com/v1/fetch?url=https%3A%2F%2Fexample.com%2F");
Console.WriteLine(response.Headers.GetValues("Gimmepage-Cost").First());
Console.WriteLine(await response.Content.ReadAsStringAsync());
Rust
// reqwest = { version = "0.12", features = ["blocking"] }
fn main() -> Result<(), Box<dyn std::error::Error>> {
let resp = reqwest::blocking::Client::new()
.get("https://gimmepage.com/v1/fetch")
.query(&[("url", "https://example.com/")])
.bearer_auth("YOUR_API_KEY")
.send()?;
println!("{:?}", resp.headers().get("gimmepage-cost"));
println!("{}", resp.text()?);
Ok(())
}
Replace YOUR_API_KEY with your key. The key goes in a header, never in the address: a key in the address is not read, so a link can never spend your credits.
Reading the answer
When the request succeeds, the answer's status is 200 and its body is the page. The details are headers:
Gimmepage-Site-Status- The status the site answered with, for example
200or404. Gimmepage-Final-Url- The address the page came from after redirects.
Gimmepage-Cost- Credits this request cost.
Gimmepage-Balance- Credits left.
Gimmepage-Request-Id- This request's ID; it is in your usage list, and support can find it.
When it fails, the status says who caused it (4xx: the request, 502 or 504: the site, 503: gimmepage) and the body is JSON with a stable code, a plain explanation and whether trying again can help. Nothing is charged. See Errors.
A site's own "not found" page is an answer too: 200 with Gimmepage-Site-Status: 404, and it is charged. The site's status is never gimmepage's own status.
Next
- Every option: API reference.
- Time, size and pace: Limits.
- Text for language models: Markdown.
- From your language: Python and JavaScript libraries.