Strona główna / SERM, specjaliści i scenariusze API

SERM, specjaliści i scenariusze API

SERM, specjaliści i scenariusze API. Żądania HTTP, parametry, schematy odpowiedzi i procedury Labrika.

W tym artykule

Dokumentacja metod API — SERM

Wybierz metodę ze spisu treści. Sprawdź metodę HTTP, ścieżkę, uprawnienia, wymagane parametry i treść żądania. Bloki JSON zawierające schema, properties i $ref opisują kontrakt; nie wysyłaj ich jako gotowej treści żądania. Przykłady żądań i schematy odpowiedzi są oznaczone osobno.

Metody w tej sekcji

POST /public-api/v1/serm/sites/{site_uuid}/cost

Zapytaj o głębokość wyszukiwania (20, 50, 100 lub 200 wyników), a następnie pokaż odpowiednią cenę analizy SERM.

Powiązane modele danych: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · AnalysisEstimate · ErrorResponse

Uprawnienia: serm:run

Parametry

site_uuid (path)
{
  "required": true,
  "schema": {
    "type": "string",
    "pattern": "^[0-9a-f]{32}$",
    "example": "d3c9e51b06a44e27831f205ceac20000"
  }
}

Żądanie

{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "depth"
        ],
        "properties": {
          "depth": {
            "type": "integer",
            "enum": [
              20,
              50,
              100,
              200
            ]
          }
        }
      }
    }
  }
}

Odpowiedzi

200

Zapytaj o głębokość wyszukiwania (20, 50, 100 lub 200 wyników), a następnie pokaż odpowiednią cenę analizy SERM.

{
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/AnalysisEstimate"
          }
        }
      }
    }
  }
}
400

Bez poprawnego klucza nagłówki limitów dotyczą nieudanych prób z IP. Po uwierzytelnieniu dotyczą klucza lub konta. Mogą być pominięte przy wcześniejszej blokadzie lub niedostępnym liczniku. X-RateLimit-Reset to czas Unix w sekundach; Retry-After przy 429 to opóźnienie w sekundach.

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
401
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
403
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
404
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
409
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
422
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
429
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}

POST /public-api/v1/serm/sites/{site_uuid}/run

Uruchom analizę po zatwierdzonej cenie, podając wycenę oraz jej Idempotency-Key.

Powiązane modele danych: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · ErrorResponse

Uprawnienia: serm:run

Parametry

site_uuid (path)
{
  "required": true,
  "schema": {
    "type": "string",
    "pattern": "^[0-9a-f]{32}$",
    "example": "d3c9e51b06a44e27831f205ceac20000"
  }
}
Idempotency-Key (header)
{
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 255
  }
}

Żądanie

{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "cost_estimate_id"
        ],
        "properties": {
          "cost_estimate_id": {
            "type": "string"
          }
        }
      }
    }
  }
}

Odpowiedzi

202

Uruchom analizę po zatwierdzonej cenie, podając wycenę oraz jej Idempotency-Key.

{
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    }
  }
}
400
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
401
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
403
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
404
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
409
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
422
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
429
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}

GET /public-api/v1/serm/sites/{site_uuid}/report

Pobierz ostatni opublikowany raport SERM lub wybierz raport przez report_id. Odpowiedź zawiera datę, język, status i dostępne sekcje.

Powiązane modele danych: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · ErrorResponse

Uprawnienia: serm:read

Parametry

site_uuid (path)
{
  "required": true,
  "schema": {
    "type": "string",
    "pattern": "^[a-f0-9]{32}$",
    "example": "d3c9e51b06a44e27831f205ceac20000"
  }
}
report_id (query)
{
  "schema": {
    "type": "string",
    "pattern": "^[0-9a-v]{20}$"
  }
}

Odpowiedzi

200

Pobierz ostatni opublikowany raport SERM lub wybierz raport przez report_id. Odpowiedź zawiera datę, język, status i dostępne sekcje.

{
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "site_uuid",
              "report_id",
              "created_at",
              "language",
              "status",
              "sections"
            ],
            "properties": {
              "site_uuid": {
                "type": "string"
              },
              "report_id": {
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "language": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "sections": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "section",
                    "report_id",
                    "status",
                    "calculated_at",
                    "data"
                  ],
                  "properties": {
                    "section": {
                      "type": "string"
                    },
                    "report_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "calculated_at": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    },
                    "data": {
                      "type": "object",
                      "nullable": true,
                      "properties": {
                        "version": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "known": {
                          "type": "integer"
                        },
                        "unknown": {
                          "type": "integer"
                        },
                        "positive": {
                          "type": "integer"
                        },
                        "neutral": {
                          "type": "integer"
                        },
                        "negative": {
                          "type": "integer"
                        },
                        "average": {
                          "type": "number",
                          "nullable": true
                        },
                        "negative_share": {
                          "type": "number",
                          "nullable": true
                        },
                        "metrics": {
                          "type": "array",
                          "nullable": true,
                          "items": {
                            "type": "object"
                          }
                        },
                        "groups": {
                          "type": "array",
                          "nullable": true,
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
400
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
401
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
403
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
404
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
409
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
422
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
429
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}

Powrót do spisu treści

Dokumentacja metod API — Specialists

Wybierz metodę ze spisu treści. Sprawdź metodę HTTP, ścieżkę, uprawnienia, wymagane parametry i treść żądania. Bloki JSON zawierające schema, properties i $ref opisują kontrakt; nie wysyłaj ich jako gotowej treści żądania. Przykłady żądań i schematy odpowiedzi są oznaczone osobno.

Metody w tej sekcji

POST /public-api/v1/specialist-requests

Przesłać do moderacji zgłoszenie w sprawie znalezienia specjalisty. Użyj zweryfikowanego adresu kontaktowego podanego w sekcji Specjaliści i zaakceptuj aktualne zasady dla klientów.

Powiązane modele danych: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · ErrorResponse

Uprawnienia: specialist-requests:write

Parametry

Idempotency-Key (header)
{
  "required": true,
  "schema": {
    "type": "string",
    "minLength": 1,
    "maxLength": 128,
    "pattern": "^[A-Za-z0-9._:-]+$"
  }
}

Żądanie

{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "required": [
          "title",
          "description",
          "category",
          "language",
          "email",
          "currency",
          "budget_type",
          "payment_methods",
          "rules_version",
          "accept_terms"
        ],
        "oneOf": [
          {
            "properties": {
              "budget_type": {
                "enum": [
                  "fixed",
                  "approximate"
                ]
              }
            },
            "required": [
              "budget_minor"
            ]
          },
          {
            "properties": {
              "budget_type": {
                "enum": [
                  "negotiable"
                ]
              }
            },
            "not": {
              "required": [
                "budget_minor"
              ]
            }
          }
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 5,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "minLength": 100,
            "maxLength": 5000
          },
          "category": {
            "type": "string",
            "enum": [
              "technical",
              "seo",
              "content",
              "speed",
              "analytics",
              "reputation",
              "directory_registration",
              "crowd_links",
              "text_optimization",
              "contextual_ads",
              "website_development",
              "website_modernization",
              "outreach"
            ],
            "example": "seo"
          },
          "language": {
            "type": "string",
            "example": "en"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "budget_type": {
            "type": "string",
            "enum": [
              "fixed",
              "approximate",
              "negotiable"
            ]
          },
          "budget_minor": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 10000000000
          },
          "payment_methods": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "bank_transfer",
                "card_transfer",
                "sbp",
                "yoomoney",
                "card_payment",
                "paypal",
                "swift",
                "bank_transfer_individual",
                "bank_transfer_business"
              ]
            }
          },
          "rules_version": {
            "type": "integer",
            "example": 2
          },
          "accept_terms": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        }
      }
    }
  }
}

Odpowiedzi

201

Zgłoszenie przesłane do moderacji.

{
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "status"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending_moderation"
                ]
              }
            }
          }
        }
      }
    }
  }
}
400

Bez poprawnego klucza nagłówki limitów dotyczą nieudanych prób z IP. Po uwierzytelnieniu dotyczą klucza lub konta. Mogą być pominięte przy wcześniejszej blokadzie lub niedostępnym liczniku. X-RateLimit-Reset to czas Unix w sekundach; Retry-After przy 429 to opóźnienie w sekundach.

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
401
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
403
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
409
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}
429
{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}

Powrót do spisu treści

Scenariusze

Wybierz wynik i wykonaj żądania w opisanej kolejności. Każdy scenariusz podaje wymagane uprawnienia.

Ustaw LABRIKA_API_KEY. Pobierz SITE_UUID i ENGINE_ID z listy witryn, a PROJECT_ID z listy projektów. Ustaw COST_ESTIMATE_ID i IDEMPOTENCY_KEY na podstawie pól cost_estimate_id i idempotency_key z wyceny. Weź RUN_ID z odpowiedzi uruchomienia. Ustaw LIST_REVISION na podstawie pola list.revision z wyniku. Po edycji listy zaktualizuj LIST_REVISION polem revision z odpowiedzi PATCH przed przeniesieniem listy.

Po przekroczeniu czasu ponów z tym samym Idempotency-Key i treścią. Przy 401 sprawdź klucz, przy 403 uprawnienia, przy 409 przyczynę konfliktu. Przy 429 uwzględnij Retry-After, jeśli jest dostępny.

Najnowsze pozycje

Odczytaj zapisane pozycje dla właściwego regionu i wyszukiwarki.

serp:read

Odczyt pozycji słów kluczowych wymaga aktywnej subskrypcji Business lub Agency. Listę witryn i daty pomiarów można odczytać z uprawnieniem serp:read.

  1. GET /serp/sites?limit=10

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/serp/sites?limit=10" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
  2. GET /serp/sites/$SITE_UUID/search-engines/$ENGINE_ID/dates?limit=5

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/serp/sites/$SITE_UUID/search-engines/$ENGINE_ID/dates?limit=5" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
  3. GET /serp/sites/$SITE_UUID/search-engines/$ENGINE_ID/positions?collected_at=last&limit=20

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/serp/sites/$SITE_UUID/search-engines/$ENGINE_ID/positions?collected_at=last&limit=20" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
Fragment odpowiedzi
{
  "data": [
    {
      "site_uuid": "d3c9e51b06a44e27831f205ceac20000",
      "host": "example.com",
      "search_engines": [
        {
          "id": 42,
          "engine_title": "Google"
        }
      ]
    }
  ]
}

Uruchom pełny audyt

Zachowaj identyfikator wyceny i sprawdzaj etap za pomocą UUID witryny.

site-audits:runmain-reports:read

  1. GET /main-reports/sites?limit=10

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/main-reports/sites?limit=10" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
  2. POST /site-audits/sites/$SITE_UUID/cost

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/site-audits/sites/$SITE_UUID/cost" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      --data '{"pages_limit":500,"payment_option":"auto"}'
  3. POST /site-audits/sites/$SITE_UUID/run

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/site-audits/sites/$SITE_UUID/run" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
      --data-binary @- <<JSON
    {"cost_estimate_id":"${COST_ESTIMATE_ID:?}"}
    JSON
  4. GET /site-audits/sites/$SITE_UUID/progress

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/site-audits/sites/$SITE_UUID/progress" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
Fragment odpowiedzi
{
  "data": {
    "cost_estimate_id": "ESTIMATE_FROM_COST",
    "idempotency_key": "KEY_FROM_COST",
    "page_credits": 500,
    "amount_minor": 0
  }
}

Frazy dla witryny

Odczytaj wynik, edytuj listę i zastosuj wybraną wersję w ustawieniach witryny.

domain-keywords:run

Na podstawie wyceny ustaw PAYMENT_OPTION na ai_credits, jeśli credits_available ma wartość true, albo na money_balance, jeśli balance_available ma wartość true. Jeśli obie wartości to false, doładuj saldo przed uruchomieniem. Przy ponownej próbie zachowaj tę samą metodę płatności.

  1. POST /domain-keywords/cost

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/domain-keywords/cost" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      --data '{"domain":"example.com","keyword_count":80}'
  2. POST /domain-keywords/run

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/domain-keywords/run" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
      --data-binary @- <<JSON
    {"cost_estimate_id":"${COST_ESTIMATE_ID:?}","payment_option":"${PAYMENT_OPTION:?}"}
    JSON
  3. GET /domain-keywords/runs/$RUN_ID/progress

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/domain-keywords/runs/$RUN_ID/progress" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
  4. GET /domain-keywords/runs/$RUN_ID

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/domain-keywords/runs/$RUN_ID" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
  5. PATCH /domain-keywords/runs/$RUN_ID/list

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/domain-keywords/runs/$RUN_ID/list" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      -X PATCH \
      --data-binary @- <<JSON
    {"revision":${LIST_REVISION:?},"mode":"append","items":[{"text":"wholesale tea"}]}
    JSON
  6. POST /domain-keywords/runs/$RUN_ID/apply

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/domain-keywords/runs/$RUN_ID/apply" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      --data-binary @- <<JSON
    {"site_uuid":"${SITE_UUID:?}","revision":${LIST_REVISION:?}}
    JSON
Fragment odpowiedzi
{
  "cost_estimate_id": "ESTIMATE_FROM_COST",
  "idempotency_key": "KEY_FROM_COST",
  "ai_credits": 40,
  "amount_minor": 20,
  "currency": "USD",
  "credits_available": true,
  "balance_available": true,
  "keyword_count": 80
}

Prompty do widoczności w AI

Opisz ofertę firmy i wykluczenia. Wybierz od 30 do 2000 promptów co 10.

prompt-suggestions:run

Na podstawie wyceny ustaw PAYMENT_OPTION na ai_credits, jeśli credits_available ma wartość true, albo na money_balance, jeśli balance_available ma wartość true. Jeśli obie wartości to false, doładuj saldo przed uruchomieniem. Przy ponownej próbie zachowaj tę samą metodę płatności.

  1. POST /prompt-suggestions/cost

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/prompt-suggestions/cost" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      --data '{"domain":"example.com","company_description":"We supply wholesale loose-leaf tea and tasting packs to cafés and independent retailers. We help customers plan their range and deliver regularly under contract.","exclusions":["Coffee","Coffee equipment","Retail purchases"],"prompt_count":30}'
  2. POST /prompt-suggestions/run

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/prompt-suggestions/run" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
      --data-binary @- <<JSON
    {"cost_estimate_id":"${COST_ESTIMATE_ID:?}","payment_option":"${PAYMENT_OPTION:?}"}
    JSON
  3. GET /prompt-suggestions/runs/$RUN_ID/progress

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/prompt-suggestions/runs/$RUN_ID/progress" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
  4. GET /prompt-suggestions/runs/$RUN_ID

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/prompt-suggestions/runs/$RUN_ID" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
  5. PATCH /prompt-suggestions/runs/$RUN_ID/list

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/prompt-suggestions/runs/$RUN_ID/list" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      -X PATCH \
      --data-binary @- <<JSON
    {"revision":${LIST_REVISION:?},"mode":"append","items":[{"text":"Where can cafés buy wholesale tea?"}]}
    JSON
  6. POST /prompt-suggestions/runs/$RUN_ID/apply

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/prompt-suggestions/runs/$RUN_ID/apply" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      --data-binary @- <<JSON
    {"site_uuid":"${SITE_UUID:?}","revision":${LIST_REVISION:?}}
    JSON
Fragment odpowiedzi
{
  "cost_estimate_id": "ESTIMATE_FROM_COST",
  "idempotency_key": "KEY_FROM_COST",
  "ai_credits": 21,
  "amount_minor": 11,
  "currency": "USD",
  "credits_available": true,
  "balance_available": true
}

Widoczność w AI

Znajdź projekty dla domeny i zdecyduj, czy użyć istniejącego projektu, czy utworzyć nowy. Uruchom raport po zatwierdzonej cenie. Użyj klucza Idempotency-Key z wyceny. Przy potwierdzeniu nowe ustawienia zastąpią dotychczasowe.

sites:createai-visibility:run

Oblicz koszt dla zapisanych lub nowych ustawień. Pomiń payment_option, aby zobaczyć koszt w kredytach AI i walucie konta. Raport ruszy po potwierdzeniu.

  1. GET /sites/by-domain?domain=example.com

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/sites/by-domain?domain=example.com" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
  2. GET /ai-visibility/sites/$SITE_UUID/models

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/ai-visibility/sites/$SITE_UUID/models" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
  3. POST /ai-visibility/sites/$SITE_UUID/cost

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/ai-visibility/sites/$SITE_UUID/cost" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      --data '{"settings":{"domain":"example.com","brand":"Acme","aliases":["Acme Studio"],"prompts":["Where can cafés order tea wholesale?"],"models":["chatgpt"],"competitors":[{"domain":"competitor.example","brand":"Rival Tea"}]}}'
  4. POST /ai-visibility/sites/$SITE_UUID/run

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/ai-visibility/sites/$SITE_UUID/run" \
      -H "Authorization: Bearer $LABRIKA_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
      --data-binary @- <<JSON
    {"cost_estimate_id":"${COST_ESTIMATE_ID:?}"}
    JSON
Fragment odpowiedzi
{
  "data": {
    "cost_estimate_id": "ESTIMATE_FROM_COST",
    "idempotency_key": "KEY_FROM_COST",
    "ai_credits": 1,
    "money_equivalent_minor": 1,
    "can_start": true
  }
}

Zmiany w witrynie

Znajdź projekt monitoringu i odczytaj najnowsze alerty.

diff-projects:readdiff-alerts:read

  1. GET /diff-projects?limit=10

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/diff-projects?limit=10" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"
  2. GET /diff-projects/$PROJECT_ID/alerts?limit=20

    curl --silent --show-error --fail-with-body "https://app.labrika.com/public-api/v1/diff-projects/$PROJECT_ID/alerts?limit=20" \
      -H "Authorization: Bearer $LABRIKA_API_KEY"

HTTP 202 oznacza przyjęcie żądania, nie zakończenie pracy. Zapisz identyfikator i sprawdzaj stan wskazaną metodą GET. HTTP 200 przy odczycie stanu też nie dowodzi sukcesu zadania: sprawdź status i pola błędu. Przestrzegaj retry_after_seconds, jeśli jest zwrócone.

Wspólny budżet API/MCP, saldo pieniężne, limity subskrypcji i kredyty AI to różne zasoby. Wycena bez pobrania pieniędzy może zużywać budżet techniczny. Przed płatną operacją sprawdź aktualną wycenę, sposób płatności i walutę odpowiedzi.

Powrót do spisu treści