LOG IN SIGN UP
Documentation

This section of the API documentation covers various utilities and extra functionality we provide in addition to the configuration services.

As always, if something does not work as expected or differs from the web interface, please contact us right away via our Support Desk or IRC (#fastly on Freenode, or webchat).

Authentication

Nearly all API calls require your request to be authenticated though a few do not. Most support using an API token or API key (labeled as Authentication: API key), but a few account level calls require using an authenticated session cookie (labeled as Authentication: session cookie). See our authentication page for more information.

API reference

The main entry point for the API is https://api.fastly.com/. For the sake of brevity, examples below omit this.

Content

Fastly makes it possible to see which version of a particular URL is cached on each edge server.


Actions

GET /content/edge_check

Retrieve headers and MD5 hash of the content for a particular URL from each Fastly edge server

Authentication

API key or session cookie with at least Engineer permissions.

Parameters
parameter type description
url string Full URL (host and path) to check on all nodes. if protocol is omitted, http will be assumed
Request Example
GET /content/edge_check?url=www.example.com/foo/bar
Accept: application/json
Response Example
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"hash": "c6447943be2cff04787d9367ddd58fa0",
"request": {
"headers": {
"Host": "www.example.com/foo/bar",
"User-Agent": "Fastly/cache-check"
},
"method": null,
"url": null
},
"response": {
"headers": {
"Accept-Ranges": "bytes",
"Age": "0",
"Connection": "keep-alive",
"Content-Length": "154189",
"Content-Type": "text/html; charset=UTF-8",
"Date": "Mon, 06 Jun 2016 15:26:05 GMT",
"ETag": "W/\"76cdf069e25c5e32bb8005982d3f8e0d\"",
"Expires": "Thu, 01 Jan 1970 00:00:00 GMT",
"Set-Cookie": [
"crumb=EUmnHJvt3XCJP2hZmlzWCvVNzOHq5Wb1;Path=/",
"SS_MID=7b22de59-a0ca-4d2f-aea2-dbe337990ba3ip466npy;Path=/;Domain=.example.com;Expires=Thu, 04-Jun-2026 15:26:05 GMT"
],
"Vary": "Accept-Encoding, User-Agent",
"Via": "1.1 varnish",
"X-Cache": "MISS",
"X-Cache-Hits": "0",
"X-ContextId": "P0IlaNKm/roP4a7jq",
"X-PC-AppVer": "7951",
"X-PC-Date": "Mon, 06 Jun 2016 15:26:04 GMT",
"X-PC-Hit": "true",
"X-PC-Host": "127.0.0.1",
"X-PC-Key": "OZs6DMRDuX2Tj7xXJlbWIZgI2cI-example",
"X-Served-By": "cache-sjc3120-SJC",
"X-ServedBy": "web029",
"X-Timer": "S1465226764.194256,VS0,VE1054",
"X-Via": "1.1 echo007"
},
"status": 200
},
"response_time": 2.604431,
"server": "cache-sjc3120"
},
]

Datacenter

List Fastly datacenters and their locations.


Actions

GET /datacenters

Get a list of all Fastly datacenters.

Authentication

API key or session cookie.

Request Example
GET /datacenters
Response Example
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"code": "AMS",
"coordinates": {
"latitude": 52.3081,
"longitude": 4.7642,
"x": 129,
"y": 42
},
"group": "Europe",
"name": "Amsterdam",
"shield": "amsterdam-nl"
},
]

Docs

Documentation of the endpoints that return the Fastly API Documentation.


Actions

GET /docs

Gets all documentation associated with the Fastly API.

Authentication

none

Request Example
GET /docs
Response Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"actions": [
{
"authentication": "key_or_engineer",
"description": [
"List all backends for a particular service and version."
],
"http_method": "GET",
"request": [
"GET /service/SU1Z0isxPaozGVKXdv0eY/version/1/backend",
"Fastly-Key: d3cafb4dde4dbeef",
"Accept: application/json"
],
"response": [
"HTTP/1.1 200 OK",
"Content-Type: application/json"
],
"response_body": [
"[",
" {",
" \"address\": \"127.0.0.1\",",
" \"auto_loadbalance\": false,",
" \"between_bytes_timeout\": 10000,",
" \"client_cert\": null,",
" \"comment\": \"\",",
" \"connect_timeout\": 1000,",
" \"error_threshold\": 0,",
" \"first_byte_timeout\": 15000,",
" \"healthcheck\": null,",
" \"hostname\": null,",
" \"ipv4\": \"127.0.0.1\",",
" \"ipv6\": null,",
" \"locked\": true,",
" \"max_conn\": 200,",
" \"max_tls_version\": null,",
" \"min_tls_version\": null,",
" \"name\": \"backend-name\",",
" \"port\": 80,",
" \"request_condition\": \"\",",
" \"service_id\": \"SU1Z0isxPaozGVKXdv0eY\",",
" \"shield\": null,",
" \"ssl_ca_cert\": null,",
" \"ssl_cert_hostname\": null,",
" \"ssl_check_cert\": true,",
" \"ssl_ciphers\": null,",
" \"ssl_client_cert\": null,",
" \"ssl_client_key\": null,",
" \"ssl_hostname\": null,",
" \"ssl_sni_hostname\": null,",
" \"use_ssl\": false,",
" \"version\": 1,",
" \"weight\": 100",
" }",
"]"
],
"url": "/service/:service_id/version/:version/backend"
},
],
"description": [
"A backend is an address (IP or domain) from which Fastly pulls content. There can be multiple backends for a service."
],
"fields": [
"address String. An hostname, IPv4, or IPv6 address for the backend.",
"auto_loadbalance Boolean. Whether or not this backend should be automatically load balanced.",
"between_bytes_timeout Integer. How long to wait between bytes in milliseconds.",
"client_cert String.",
"comment String.",
"connect_timeout Integer. How long to wait for a timeout in milliseconds.",
"error_threshold Integer. Number of errors to allow before the backend is marked as down.",
"first_byte_timeout Integer. How long to wait for the first bytes in milliseconds.",
"healthcheck String. The name of the healthcheck to use with this backend. Can be empty.",
"hostname String. The hostname of the backend.",
"ipv4 String. IPv4 address of the host.",
"ipv6 String. IPv6 address of the host.",
"locked Boolean. Specifies whether or not the version is locked for editing.",
"max_conn Integer. Maximum number of connections.",
"max_tls_version Integer. Maximum allowed TLS version on SSL connections to this backend.",
"min_tls_version Integer. Minimum allowed TLS version on SSL connections to this backend.",
"name String. The name of the backend.",
"port Integer. The port number.",
"request_condition String. Condition, which if met, will select this backend during a request.",
"service_id String. The alphanumeric string identifying a service.",
"shield String. The shield POP designated to reduce inbound load on this origin by serving the cached data to the rest of the network.",
"ssl_ca_cert String. CA certificate attached to origin.",
"ssl_cert_hostname String. Overrides ssl_hostname, but only for cert verification. Does not affect SNI at all.",
"ssl_check_cert Boolean. Be strict on checking SSL certs.",
"ssl_ciphers String. List of openssl ciphers (see https://www.openssl.org/docs/manmaster/apps/ciphers.html for details)",
"ssl_client_cert String. Client certificate attached to origin.",
"ssl_client_key String. Client key attached to origin.",
"ssl_hostname String. Used for both SNI during the TLS handshake and to validate the cert.",
"ssl_sni_hostname String. Overrides ssl_hostname, but only for SNI in the handshake. Does not affect cert validation at all.",
"use_ssl Boolean. Whether or not to use SSL to reach the backend.",
"version Integer. The current version number of a service.",
"weight Integer. Weight used to load balance this backend against others."
],
"section": "backend"
}

GET /docs/subject/endpoint

Gets all documentation relating to a given 'Subject'

Authentication

none

Parameters
parameter type description
subject string The subject to search for.
Request Example
GET /docs/subject/:subject
Response Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"actions": [
{
"authentication": "key_or_engineer",
"description": [
"List all backends for a particular service and version."
],
"http_method": "GET",
"request": [
"GET /service/SU1Z0isxPaozGVKXdv0eY/version/1/backend",
"Fastly-Key: d3cafb4dde4dbeef",
"Accept: application/json"
],
"response": [
"HTTP/1.1 200 OK",
"Content-Type: application/json"
],
"response_body": [
"[",
" {",
" \"address\": \"127.0.0.1\",",
" \"auto_loadbalance\": false,",
" \"between_bytes_timeout\": 10000,",
" \"client_cert\": null,",
" \"comment\": \"\",",
" \"connect_timeout\": 1000,",
" \"error_threshold\": 0,",
" \"first_byte_timeout\": 15000,",
" \"healthcheck\": null,",
" \"hostname\": null,",
" \"ipv4\": \"127.0.0.1\",",
" \"ipv6\": null,",
" \"locked\": true,",
" \"max_conn\": 200,",
" \"max_tls_version\": null,",
" \"min_tls_version\": null,",
" \"name\": \"backend-name\",",
" \"port\": 80,",
" \"request_condition\": \"\",",
" \"service_id\": \"SU1Z0isxPaozGVKXdv0eY\",",
" \"shield\": null,",
" \"ssl_ca_cert\": null,",
" \"ssl_cert_hostname\": null,",
" \"ssl_check_cert\": true,",
" \"ssl_ciphers\": null,",
" \"ssl_client_cert\": null,",
" \"ssl_client_key\": null,",
" \"ssl_hostname\": null,",
" \"ssl_sni_hostname\": null,",
" \"use_ssl\": false,",
" \"version\": 1,",
" \"weight\": 100",
" }",
"]"
],
"url": "/service/:service_id/version/:version/backend"
},
],
"description": [
"A backend is an address (IP or domain) from which Fastly pulls content. There can be multiple backends for a service."
],
"fields": [
"address String. An hostname, IPv4, or IPv6 address for the backend.",
"auto_loadbalance Boolean. Whether or not this backend should be automatically load balanced.",
"between_bytes_timeout Integer. How long to wait between bytes in milliseconds.",
"client_cert String.",
"comment String.",
"connect_timeout Integer. How long to wait for a timeout in milliseconds.",
"error_threshold Integer. Number of errors to allow before the backend is marked as down.",
"first_byte_timeout Integer. How long to wait for the first bytes in milliseconds.",
"healthcheck String. The name of the healthcheck to use with this backend. Can be empty.",
"hostname String. The hostname of the backend.",
"ipv4 String. IPv4 address of the host.",
"ipv6 String. IPv6 address of the host.",
"locked Boolean. Specifies whether or not the version is locked for editing.",
"max_conn Integer. Maximum number of connections.",
"max_tls_version Integer. Maximum allowed TLS version on SSL connections to this backend.",
"min_tls_version Integer. Minimum allowed TLS version on SSL connections to this backend.",
"name String. The name of the backend.",
"port Integer. The port number.",
"request_condition String. Condition, which if met, will select this backend during a request.",
"service_id String. The alphanumeric string identifying a service.",
"shield String. The shield POP designated to reduce inbound load on this origin by serving the cached data to the rest of the network.",
"ssl_ca_cert String. CA certificate attached to origin.",
"ssl_cert_hostname String. Overrides ssl_hostname, but only for cert verification. Does not affect SNI at all.",
"ssl_check_cert Boolean. Be strict on checking SSL certs.",
"ssl_ciphers String. List of openssl ciphers (see https://www.openssl.org/docs/manmaster/apps/ciphers.html for details)",
"ssl_client_cert String. Client certificate attached to origin.",
"ssl_client_key String. Client key attached to origin.",
"ssl_hostname String. Used for both SNI during the TLS handshake and to validate the cert.",
"ssl_sni_hostname String. Overrides ssl_hostname, but only for SNI in the handshake. Does not affect cert validation at all.",
"use_ssl Boolean. Whether or not to use SSL to reach the backend.",
"version Integer. The current version number of a service.",
"weight Integer. Weight used to load balance this backend against others."
],
"section": "backend"
}

GET /docs/section/section

Gets all documentation associated with a given Categorical Section where :section is a regular_expression. passing invert=true will force a return of everything that does not match the given regular_expression

Authentication

none

Parameters
parameter type description
section string The subject to search for.
invert boolean Get everything that does not match section
Request Example
GET /docs/section/:section
Response Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"actions": [
{
"authentication": "key_or_engineer",
"description": [
"List all backends for a particular service and version."
],
"http_method": "GET",
"request": [
"GET /service/SU1Z0isxPaozGVKXdv0eY/version/1/backend",
"Fastly-Key: d3cafb4dde4dbeef",
"Accept: application/json"
],
"response": [
"HTTP/1.1 200 OK",
"Content-Type: application/json"
],
"response_body": [
"[",
" {",
" \"address\": \"127.0.0.1\",",
" \"auto_loadbalance\": false,",
" \"between_bytes_timeout\": 10000,",
" \"client_cert\": null,",
" \"comment\": \"\",",
" \"connect_timeout\": 1000,",
" \"error_threshold\": 0,",
" \"first_byte_timeout\": 15000,",
" \"healthcheck\": null,",
" \"hostname\": null,",
" \"ipv4\": \"127.0.0.1\",",
" \"ipv6\": null,",
" \"locked\": true,",
" \"max_conn\": 200,",
" \"max_tls_version\": null,",
" \"min_tls_version\": null,",
" \"name\": \"backend-name\",",
" \"port\": 80,",
" \"request_condition\": \"\",",
" \"service_id\": \"SU1Z0isxPaozGVKXdv0eY\",",
" \"shield\": null,",
" \"ssl_ca_cert\": null,",
" \"ssl_cert_hostname\": null,",
" \"ssl_check_cert\": true,",
" \"ssl_ciphers\": null,",
" \"ssl_client_cert\": null,",
" \"ssl_client_key\": null,",
" \"ssl_hostname\": null,",
" \"ssl_sni_hostname\": null,",
" \"use_ssl\": false,",
" \"version\": 1,",
" \"weight\": 100",
" }",
"]"
],
"url": "/service/:service_id/version/:version/backend"
},
],
"description": [
"A backend is an address (IP or domain) from which Fastly pulls content. There can be multiple backends for a service."
],
"fields": [
"address String. An hostname, IPv4, or IPv6 address for the backend.",
"auto_loadbalance Boolean. Whether or not this backend should be automatically load balanced.",
"between_bytes_timeout Integer. How long to wait between bytes in milliseconds.",
"client_cert String.",
"comment String.",
"connect_timeout Integer. How long to wait for a timeout in milliseconds.",
"error_threshold Integer. Number of errors to allow before the backend is marked as down.",
"first_byte_timeout Integer. How long to wait for the first bytes in milliseconds.",
"healthcheck String. The name of the healthcheck to use with this backend. Can be empty.",
"hostname String. The hostname of the backend.",
"ipv4 String. IPv4 address of the host.",
"ipv6 String. IPv6 address of the host.",
"locked Boolean. Specifies whether or not the version is locked for editing.",
"max_conn Integer. Maximum number of connections.",
"max_tls_version Integer. Maximum allowed TLS version on SSL connections to this backend.",
"min_tls_version Integer. Minimum allowed TLS version on SSL connections to this backend.",
"name String. The name of the backend.",
"port Integer. The port number.",
"request_condition String. Condition, which if met, will select this backend during a request.",
"service_id String. The alphanumeric string identifying a service.",
"shield String. The shield POP designated to reduce inbound load on this origin by serving the cached data to the rest of the network.",
"ssl_ca_cert String. CA certificate attached to origin.",
"ssl_cert_hostname String. Overrides ssl_hostname, but only for cert verification. Does not affect SNI at all.",
"ssl_check_cert Boolean. Be strict on checking SSL certs.",
"ssl_ciphers String. List of openssl ciphers (see https://www.openssl.org/docs/manmaster/apps/ciphers.html for details)",
"ssl_client_cert String. Client certificate attached to origin.",
"ssl_client_key String. Client key attached to origin.",
"ssl_hostname String. Used for both SNI during the TLS handshake and to validate the cert.",
"ssl_sni_hostname String. Overrides ssl_hostname, but only for SNI in the handshake. Does not affect cert validation at all.",
"use_ssl Boolean. Whether or not to use SSL to reach the backend.",
"version Integer. The current version number of a service.",
"weight Integer. Weight used to load balance this backend against others."
],
"section": "backend"
}

Public IP List

To help you whitelist Fastly's services through your firewall, we provide access to the list of Fastly's assigned IP ranges.


Actions

GET /public-ip-list

List public IP addresses for Fastly network

Authentication

none

Request Example
GET /public-ip-list
Accept: application/json
Response Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"addresses": [
"23.235.32.0/20",
"43.249.72.0/22",
"103.244.50.0/24",
"103.245.222.0/23",
"103.245.224.0/24",
"104.156.80.0/20",
"151.101.0.0/16",
"157.52.64.0/18",
"172.111.64.0/18",
"185.31.16.0/22",
"199.27.72.0/21",
"199.232.0.0/16",
"202.21.128.0/24",
"203.57.145.0/24"
]
}