Projects

You can create, update, delete and execute sitemap generation through our API, for each of your projects.

Retrieve a project

GET https://sitemap.sh/api/projects/:key

This endpoint will provide a specific project you specify.

Path Parameters

Name
Type
Description

key

string

The project key to identify which project we will retrieve.

{
  "user_id": 1,
  "key": "ekajd98u12j",
  "name": "example",
  "primary_url": "https:\/\/www.example.com",
  "status": "idle",
  "enabled": 0,
  "processed_at": null,
  "created_at": "yyyy-mm-dd h:m:s",
  "updated_at": "yyyy-mm-dd h:m:s",
  "image_url": "https:\/\/www.gravatar.com\/avatar\/37ffc9301f7b2497941f6b8bdc3904db.jpg?s=200&d=identicon",
  "last_run_date": "yyyy, mmm dd",
  "last_run_time": "m:s",
  "locations": [
      {
        "id": 2,
        "project_id": 1,
        "priority": null,
        "change_frequency": null,
        "last_modification_date": null,
        "type": "exclude",
        "url": "https:\/\/www.example.com\/contact-us",
        "created_at": "created_at",
        "updated_at": "created_at"
      }
  ]
}

Retrieve all projects

GET https://sitemap.sh/api/projects

This endpoint will provide all the projects you own.

Retrieve locations for a project

GET https://sitemap.sh/api/projects/:key/locations

This endpoint will provide the locations for a specific endpoint you specify. These are included in the /projects/:key request as well, but a separate endpoint for the locations may come in handy.

Path Parameters

Name
Type
Description

key

string

The project key to identify the project.

Create a project

PUT https://sitemap.sh/api/projects/:key

You can create a new project through this endpoint.

Path Parameters

Name
Type
Description

key

string

The key to identify your project.

Request Body

Name
Type
Description

primary_url

string

The primary URL for your project, which we will use to crawl your site for URL's to add to your sitemap.

name

string

The name for your new project.

Update a project

POST https://sitemap.sh/api/projects/:key

You can update an existing project through this endpoint.

Path Parameters

Name
Type
Description

key

string

The key to identify the project you want to update.

Request Body

Name
Type
Description

locations

array

Your project's locations.

primary_url

string

Your project's primary url.

name

string

Your project's name.

Update a project's locations

POST https://sitemap.sh/api/projects/:key/locations

You can update an existing project's locations

Path Parameters

Name
Type
Description

key

string

The key used to identify your project.

Request Body

Name
Type
Description

locations

array

Your new locations. Use the same format they appear in for retrieving locations.

Generate the sitemap for a project

POST https://sitemap.sh/api/projects/:key/process

Start generating a fresh sitemap file, which you can download later on.

Path Parameters

Name
Type
Description

key

string

The key to identify your project.

Last updated

Was this helpful?