Skip to content

Latest commit

 

History

History
72 lines (57 loc) · 3.13 KB

README.md

File metadata and controls

72 lines (57 loc) · 3.13 KB

Yellow Pages API

This repository contains the code for completely scraping the yellow pages website to get the details of all the categories from all the cities in America and then turning all of the data into an api to be used later. The api data is well visualized here as example here.

Test the API at: API Testing
Example route at: Dentists in Las Vegas

GIF

http://hrushis-yellow-pages-end-api.herokuapp.com/<search-term>/<us-city>
http://hrushis-yellow-pages-end-api.herokuapp.com/<search-term>/<us-city>/<plier>

Using the API

There are 2 different routes available for this api. One withour plier and another with plier.

plier: Every website can not contain all the details on a single page, to overcome this multiple pages are used which hold around 30 cards of data. So every plier you include, it is a multiple of 30 to get the number of data.

The following images show with code how to get the data from this api. A live testing route is already available here.

IMG

IMG

API Data

First 2 samples from this route: http://hrushis-yellow-pages-end-api.herokuapp.com/repair/texas/5 are shown here.
The key contains the number and the value contains the actual data in a nested dictionary. The keys in the dictionary and there values are well explained below.

Address: The address of the entity included in the call.
Categories: To what types of other services the entity is in.
More-info : To get more information about the entity on the yellow pages website
Name: Name of the entity.
Phone-number: Telephone number for contacting the entity.
Status: Opened or Closed status of the entity.
Website: Own website of the enitity.

null: Data for that key was not available.

{
  "1": {
    "Address": null,
    "Categories": [
      "Auto Repair & Service",
      "Tire Dealers"
    ],
    "More-info": "https://www.yellowpages.com/nationwide/mip/firestone-complete-auto-care-497692017?lid=1001662607171",
    "Name": "Firestone Complete Auto Care",
    "Phone-number": "(800) 364-4314",
    "Status": null,
    "Website": "http://www.firestonecompleteautocare.com/repair/services.jsp?lw_cmp=IYP_YPC_NPLL_Service"
  },
  "2": {
    "Address": null,
    "Categories": [
      "Auto Repair & Service",
      "Automobile Salvage",
      "Automobile & Truck Brokers"
    ],
    "More-info": "https://www.yellowpages.com/nationwide/mip/1-800-car-buyers-481040864?lid=1000123041450",
    "Name": "1 800 Car Buyers",
    "Phone-number": "(888) 495-3593",
    "Status": null,
    "Website": "http://www.800carbuyers.com/?st-t=yp-carbuyer"
  }
}