Skip to main content
POST
/
map
Map multiple URLs based on options
curl --request POST \
  --url https://api.firecrawl.dev/v2/map \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "search": "<string>",
  "sitemap": "include",
  "includeSubdomains": true,
  "ignoreQueryParameters": true,
  "ignoreCache": false,
  "limit": 5000,
  "location": {
    "country": "US",
    "languages": [
      "en-US"
    ]
  },
  "timeout": 60000
}
'
import requests

url = "https://api.firecrawl.dev/v2/map"

payload = {
"url": "<string>",
"search": "<string>",
"sitemap": "include",
"includeSubdomains": True,
"ignoreQueryParameters": True,
"ignoreCache": False,
"limit": 5000,
"location": {
"country": "US",
"languages": ["en-US"]
},
"timeout": 60000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
search: '<string>',
sitemap: 'include',
includeSubdomains: true,
ignoreQueryParameters: true,
ignoreCache: false,
limit: 5000,
location: {country: 'US', languages: ['en-US']},
timeout: 60000
})
};

fetch('https://api.firecrawl.dev/v2/map', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.firecrawl.dev/v2/map",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'search' => '<string>',
'sitemap' => 'include',
'includeSubdomains' => true,
'ignoreQueryParameters' => true,
'ignoreCache' => false,
'limit' => 5000,
'location' => [
'country' => 'US',
'languages' => [
'en-US'
]
],
'timeout' => 60000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.firecrawl.dev/v2/map"

payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"search\": \"<string>\",\n \"sitemap\": \"include\",\n \"includeSubdomains\": true,\n \"ignoreQueryParameters\": true,\n \"ignoreCache\": false,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"timeout\": 60000\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.firecrawl.dev/v2/map")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"search\": \"<string>\",\n \"sitemap\": \"include\",\n \"includeSubdomains\": true,\n \"ignoreQueryParameters\": true,\n \"ignoreCache\": false,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"timeout\": 60000\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.firecrawl.dev/v2/map")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"search\": \"<string>\",\n \"sitemap\": \"include\",\n \"includeSubdomains\": true,\n \"ignoreQueryParameters\": true,\n \"ignoreCache\": false,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"timeout\": 60000\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "links": [
    {
      "url": "<string>",
      "title": "<string>",
      "description": "<string>"
    }
  ]
}
{
"error": "Payment required to access this resource."
}
{
"error": "Request rate limit exceeded. Please wait and try again later."
}
{
"error": "An unexpected error occurred on the server."
}
Are you an AI agent that needs a Firecrawl API key? See firecrawl.dev/agent-onboarding/SKILL.md for automated onboarding instructions.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
url
string<uri>
required

The base URL to start crawling from

Specify a search query to order the results by relevance. Example: 'blog' will return URLs that contain the word 'blog' in the URL ordered by relevance.

sitemap
enum<string>
default:include

Sitemap mode when mapping. If you set it to skip, the sitemap won't be used to find URLs. If you set it to only, only URLs that are in the sitemap will be returned. By default (include), the sitemap and other methods will be used together to find URLs.

Available options:
skip,
include,
only
includeSubdomains
boolean
default:true

Include subdomains of the website

ignoreQueryParameters
boolean
default:true

Do not return URLs with query parameters

ignoreCache
boolean
default:false

Bypass the sitemap cache to retrieve fresh URLs. Sitemap data is cached for up to 7 days; use this parameter when your sitemap has been recently updated.

limit
integer
default:5000

Maximum number of links to return

Required range: x <= 100000
timeout
integer

Timeout in milliseconds. There is no timeout by default.

location
object

Location settings for the request. When specified, this will use an appropriate proxy if available and emulate the corresponding language and timezone settings. Defaults to 'US' if not specified.

threatProtection
Threat Protection Override · object

Per-request Threat Protection override. Fields you provide replace the corresponding fields of your organization's policy for this request only; omitted fields keep their organization-level values. Requires Threat Protection to be enabled for your team (enterprise feature) — otherwise the request is rejected with a 403. If your organization has disabled request overrides, any request that includes this object is rejected with a 403. If Threat Protection is enforced for your team, mode may not be set to off.

Response

Successful response

success
boolean