Skip to main content

Scan Endpoint

Analyze your project’s dependencies for compatibility issues. Get a comprehensive compatibility score and detailed breakdown of any problems.

Endpoint

POST /api/v1/scan

Request

Headers

HeaderTypeRequiredDescription
Content-TypestringYesMust be application/json

Body

Provide one of the following:
FieldTypeRequiredDescription
dependenciesstring[]ConditionalArray of package names
packageJsonobjectConditionalFull package.json object

Example Requests

With dependencies array:
{
  "dependencies": ["next", "prisma", "@vercel/node", "tailwindcss"]
}
With package.json:
{
  "packageJson": {
    "dependencies": {
      "next": "^14.0.0",
      "prisma": "^5.0.0",
      "@vercel/node": "^3.0.0"
    },
    "devDependencies": {
      "tailwindcss": "^3.4.0"
    }
  }
}

Response

Success Response (200)

{
  "version": "1.0",
  "stack": {
    "detected": ["nextjs", "prisma", "vercel", "tailwind"],
    "allPackages": ["next", "prisma", "@vercel/node", "tailwindcss"],
    "score": 85,
    "issues": [
      {
        "severity": "warning",
        "pair": "prisma-vercel",
        "message": "Prisma does not support Edge Runtime.",
        "workaround": "Use dynamic imports with 'ssr: false' for routes using Prisma."
      }
    ],
    "suggestions": [
      {
        "type": "alternative",
        "message": "Consider using Turso or PlanetScale for Edge-compatible database",
        "url": "https://devradar.dev/check/prisma-vercel-edge"
      }
    ]
  },
  "metadata": {
    "scannedAt": "2025-01-15T10:30:00Z",
    "dependencyCount": 4
  }
}

Response Fields

FieldTypeDescription
versionstringAPI version (always “1.0”)
stack.detectedstring[]Recognized technology IDs
stack.allPackagesstring[]All packages from input
stack.scorenumberOverall compatibility score (0-100)
stack.issuesarrayCompatibility issues found
stack.suggestionsarrayImprovement suggestions
metadata.scannedAtstringISO 8601 timestamp
metadata.dependencyCountnumberTotal dependencies scanned

Issue Object

FieldTypeDescription
severitystringinfo, warning, error
pairstringTechnology pair identifier
messagestringIssue description
workaroundstringnullSuggested fix

Suggestion Types

TypeDescription
alternativeSuggests different technology
upgradeSuggests version upgrade
configSuggests configuration change

Score Calculation

Scores are calculated based on compatibility pairs:
StatusPoints
Compatible+10
Partial+5
Incompatible-20
Unknown0
Final score is normalized to 0-100 scale.

Code Examples

cURL

curl -X POST https://devradar.dev/api/v1/scan \
  -H "Content-Type: application/json" \
  -d '{"dependencies": ["next", "prisma", "vercel"]}'

JavaScript (fetch)

const response = await fetch('https://devradar.dev/api/v1/scan', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    dependencies: ['next', 'prisma', 'vercel']
  })
});

const data = await response.json();
console.log(`Score: ${data.stack.score}/100`);
data.stack.issues.forEach(issue => {
  console.log(`- ${issue.severity}: ${issue.message}`);
});

Python (requests)

import requests

response = requests.post('https://devradar.dev/api/v1/scan', json={
    'dependencies': ['next', 'prisma', 'vercel']
})

data = response.json()
print(f"Score: {data['stack']['score']}/100")

for issue in data['stack']['issues']:
    print(f"- {issue['severity']}: {issue['message']}")

Go

package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    payload := map[string][]string{
        "dependencies": {"next", "prisma", "vercel"},
    }
    body, _ := json.Marshal(payload)

    resp, _ := http.Post(
        "https://devradar.dev/api/v1/scan",
        "application/json",
        bytes.NewBuffer(body),
    )
    defer resp.Body.Close()

    var data map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&data)

    stack := data["stack"].(map[string]interface{})
    println("Score:", stack["score"])
}

Error Responses

400 Bad Request - No Tech Detected

{
  "version": "1.0",
  "error": {
    "code": "NO_TECH_DETECTED",
    "message": "No recognized technologies found in dependencies",
    "details": "Ensure you have valid packages in your package.json"
  }
}

400 Bad Request - Invalid Input

{
  "version": "1.0",
  "error": {
    "code": "INVALID_INPUT",
    "message": "Request body is required."
  }
}

429 Rate Limit Exceeded

{
  "version": "1.0",
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Please try again later.",
    "details": "Reset at 2025-01-15T10:31:00Z"
  }
}

Package Recognition

Common package patterns are automatically recognized:
Package PatternDetected As
nextnextjs
prismaprisma
@prisma/clientprisma
tailwindcsstailwind
next-authnext-auth
@supabase/supabase-jssupabase
Packages not in the recognition database are ignored for compatibility checking but included in allPackages.

Rate Limiting

  • Limit: 10 requests per minute
  • Headers: X-RateLimit-Remaining, X-RateLimit-Reset
See Rate Limits for details.

What’s Next


Try it now: Project Scanner