Skip to content

rachellcostello/top10-seo-list-for-developers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drawing

Top 10 things developers need to know about SEO

A Simple API containing a curated set of metrics about the health of a webpage from the technical SEO point of view. It should act as a starting point for an engineer who likes to play and learn more about extracting insights from web pages for the purposes of SEO or testing.

Prerequisites

  • nodejs >=12
  • yarn > 1

Installing

To install dependecies

yarn install

To build and run

yarn starts

Using the API

  • URL /api/page-health

  • Method:

    • GET
  • URL Params

    Required:

    • url=[string]
  • Response

The endpoints response will be an array of all the metrics below, each with a unique name and interface for the value property. If value property is an array, then the isArray property will be true.

type property is the name of the data type of the value property and when value is an array, then type name will be the name of the data type of it's items.

[{
    value: "any",
    type: "string|number|object|boolean"
    name: "string name of metric",
    isArray: true | false
  },
  ...
]

List of metrics

isResponsive

{
  "value": true | false,
  "type": "boolean",
  "name": "isResponsive",
  "isArray": false
}

isNoIndex

{
  "value": true | false,
  "type": "boolean",
  "name": "isNoIndex",
  "isArray": false
}

internalLinks

{
  value: [{
    href: "https://stackoverflow.com",
    listeners: [{
      type: "click",
      useCapture: false,
      passive: false,
      once: false,
      scriptId: "12",
      lineNumber: 2,
      columnNumber: 9085
    }],
    text: " Stack Overflow ",
    healthy: true
  }],
  type: "object",
  name: "internalLinks",
  isArray: true
}

performanceMetrics

{
  value: [{
      name: "first-paint",
      entryType: "paint",
      startTime: 1171.500000054948,
      duration: 0
    },
    {
      name: "first-contentful-paint",
      entryType: "paint",
      startTime: 1171.500000054948,
      duration: 0
    }
  ],
  type: "object",
  name: "internalLinks",
  isArray: true
}

PerformanceEntry: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry

tfIdfScore

{
  value: [{
      term: "http",
      tf: 22,
      idf: 0.3068528194400547,
      tfidf: 6.750762027681204
    },
    {
      term: "request",
      tf: 22,
      idf: 0.3068528194400547,
      tfidf: 6.750762027681204
    },
    {
      term: "status",
      tf: 19,
      idf: 0.3068528194400547,
      tfidf: 5.830203569361039
    }
  ],
  type: "object",
  name: "internalLinks",
  isArray: true
}

tfIdfTerm: https://github.com/NaturalNode/natural#tf-idf

responseStatus

{
  "value": 200,
  "type": "number",
  "name": "responseStatus",
  "isArray": false
}

schemaOrg

{
  value: [{
    @type: "Answer",
    upvoteCount: "200",
    text: " I recommend status code 422, "
    Unprocessable Entity ". 11.2. 422 Unprocessable Entity The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions. ",
    dateCreated: "",
    url: "/a/3291292"
  }]
  type: "object",
  name: "schemaOrg",
  isArray: true
}

redirectChain

{
  value: [{
    url: "https://stackoverflow.com/questions/3290182/rest-http-status-codes-for-failed-validation-or-invalid-duplicate",
    status: 200,
    isRedirect: false
  }]
  type: "object",
  name: "redirectChain",
  isArray: true
}

allowedInRobotsTxt

  {
    value: {
      isAllowed: true,
      matchedAtLine: 68
    },
    type: "object",
    name: "allowedInRobotsTxt",
    isArray: false
  }

Code Documentation

If you like to read how each metric is calculated please refer to the code documentation.

High level API

High level API

Metric example: Internal links

High level API

Built With ❤️ using

  • TypeScript - JavaScript that scales
  • Puppeteer - Headless Chrome Node.js API
  • cheerio - jQuery designed specifically for the server

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

About

The top 10 things developers need to know about SEO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 51.1%
  • TypeScript 48.9%