Reports

From Advice Local Wiki
Revision as of 15:28, 13 December 2017 by Psu (talk | contribs) (Example Response)
Jump to: navigation, search

Trigger a Report

This endpoint will generate a Baseline Report.

API Endpoint

http://p.lssdev.com/legacyclients/{$client_id}/refresh

Example Request

GET /legacyclients/12345/refresh HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": "report initiated"
}

Directory Data Report

API Endpoint

http://p.lssdev.com/legacydirectorydata?client={client_id}

Example Request

GET /legacydirectorydata?client=12345 HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": [
        {
            "client": 12345,
            "partner": 7,
            "data": {
                "dirName": "Chamberofcommerce",
                "dirHandle": "chamberofcommerce",
                "dirQuery": "https://www.chamberofcommerce.com/search/results?what=gina%27s+pizza&where=newport+beach%2C+ca",
                "results": 4,
                "result": [
                    {
                        "link": "https://www.chamberofcommerce.com/newport-beach-ca/25230470-ginas-pizza",
                        "methods": {
                            "url": "https://www.chamberofcommerce.com/search/results?what=gina%27s+pizza&where=newport+beach%2C+ca",
                            "enclosure": "main-content",
                            "enctype": "class"
                        },
                        "title": "Gina's Pizza",
                        "tech": "false",
                        "nap": {
                            "nap": {
                                "name": "Gina's Pizza",
                                "address": "3142 W Balboa Blvd -  Newport Beach, California 92663",
                                "phone": "(949) 723-4462",
                                "n": {
                                    "percentage": 100
                                },
                                "a": {
                                    "percentage": 100
                                },
                                "p": {
                                    "percentage": 100
                                }
                            },
                            "score": 100
                        },
                        "fulfillment": false
                    },
                    {
                        "link": "https://www.chamberofcommerce.com/newport-beach-ca/32128621-ginas-pizza",
                        "methods": {
                            "url": "https://www.chamberofcommerce.com/search/results?what=gina%27s+pizza&where=newport+beach%2C+ca",
                            "enclosure": "main-content",
                            "enctype": "class"
                        },
                        "title": "Ginas Pizza Inc",
                        "tech": "false",
                        "nap": {
                            "nap": {
                                "name": "Ginas Pizza Inc",
                                "address": "309 Palm St -  Newport Beach, California 92661",
                                "phone": "(949) 673-8516",
                                "n": {
                                    "percentage": 100
                                },
                                "a": {
                                    "percentage": 77
                                },
                                "p": {
                                    "percentage": 60
                                }
                            },
                            "score": 79
                        },
                        "fulfillment": false
                    },
                    {
                        "link": "https://www.chamberofcommerce.com/newport-beach-ca/44339193-ginas-pizza-newport",
                        "methods": {
                            "url": "https://www.chamberofcommerce.com/search/results?what=gina%27s+pizza&where=newport+beach%2C+ca",
                            "enclosure": "main-content",
                            "enctype": "class"
                        },
                        "title": "Ginas Pizza Newport",
                        "tech": "false",
                        "nap": {
                            "nap": {
                                "name": "Ginas Pizza Newport",
                                "address": "4507 W Coast Hwy -  Newport Beach, California 92663",
                                "phone": "(949) 722-1236",
                                "n": {
                                    "percentage": 74
                                },
                                "a": {
                                    "percentage": 80
                                },
                                "p": {
                                    "percentage": 70
                                }
                            },
                            "score": 75
                        },
                        "fulfillment": false
                    },
                    {
                        "link": "https://www.chamberofcommerce.com/newport-beach-ca/34418872-ginas-pizza-inc",
                        "methods": {
                            "url": "https://www.chamberofcommerce.com/search/results?what=gina%27s+pizza&where=newport+beach%2C+ca",
                            "enclosure": "main-content",
                            "enctype": "class"
                        },
                        "title": "Gina's Pizza Inc",
                        "tech": "false",
                        "nap": {
                            "nap": {
                                "name": "Gina's Pizza Inc",
                                "address": "Po Box 11269 -  Newport Beach, California 92658",
                                "phone": "(949) 760-0848",
                                "n": {
                                    "percentage": 100
                                },
                                "a": {
                                    "percentage": 68
                                },
                                "p": {
                                    "percentage": 50
                                }
                            },
                            "score": 73
                        },
                        "fulfillment": false
                    }
                ]
            },
            "results": "true",
            "errors": "false",
            "score": 100,
            "id": 52444619,
            "batch": "320192620171213",
            "createdAt": "2017-12-13T22:07:55.000Z",
            "directory": "chamberofcommerce",
            "elapsedTime": 1148
        },
        {
            "client": 12345,
            "partner": 7,
            "data": {
                "dirName": "2findlocal",
                "dirHandle": "2findlocal",
                "dirQuery": "http://www.2findlocal.com/search?k=gina+pizza&w=newport+beach%2C+ca",
                "results": 0
            },
            "results": "false",
            "errors": "false",
            "score": 0,
            "id": 52444620,
            "batch": "320192620171213",
            "createdAt": "2017-12-13T22:07:56.000Z",
            "directory": "2findlocal",
            "elapsedTime": 1606
        },
        {
            "client": 12345,
            "partner": 7,
            "data": {
                "dirName": "Angieslist",
                "dirHandle": "angieslist",
                "dirQuery": "https://www.google.com/search?q=site%3Aangieslist.com%2Fcompanylist%2F+Gina%27s+Pizza+Newport+Beach%2C+CA&ie=utf-8&hl=en&as_qdr=all&aq=t&rls=org:mozilla:us:official&client=firefox&num=2&filter=1&nojs=1",
                "results": 0
            },
            "results": "false",
            "errors": "false",
            "score": 0,
            "id": 52444621,
            "batch": "320192620171213",
            "createdAt": "2017-12-13T22:07:56.000Z",
            "directory": "angieslist",
            "elapsedTime": 2089
        },
        {...},
        {...}
    ],
    "total": 39
}

Local Data Report

API Endpoint

http://p.lssdev.com/legacylocaldata?client={client_id}

Example Request

GET /legacylocaldata?client=12345 HTTP/1.1
Host: p.lssdev.com
x-api-token: pk_3d5e01ef4ef113a158bcce657af6f1cd
Content-Type: application/json

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": [
        {
            "client": 12345,
            "partner": 7,
            "link": "http://www.yelp.com/biz/ginas-pizza-newport-beach-2?osq=Gina%27s+Pizza",
            "claimed": "null",
            "hours": "true",
            "description": "null",
            "categories": 3,
            "photos": 0,
            "website": "http://ginaspizza.com",
            "n": "Gina?s Pizza",
            "a": "3142 W Balboa Blvd Newport Beach, CA 92663",
            "p": "(949) 723-4462",
            "id": 6945921,
            "createdAt": "2017-12-13T22:08:39.000Z",
            "directory": "yelp",
            "batch": "3201926-2017-12-13 22:08:39",
            "nScore": 100,
            "aScore": 100,
            "pScore": 100,
            "napScore": 100,
            "data": {
                "n": "Gina?s Pizza",
                "link": "http://www.yelp.com/biz/ginas-pizza-newport-beach-2?osq=Gina%27s+Pizza",
                "a": "3142 W Balboa Blvd Newport Beach, CA 92663",
                "p": "(949) 723-4462",
                "local": {
                    "website": "ginaspizza.com",
                    "categories": [
                        "pizza",
                        "italian",
                        "sandwiches"
                    ],
                    "opening_hours": [
                        {
                            "day": "Mon",
                            "open": "11:00 am",
                            "close": "9:30 pm"
                        },
                        {
                            "day": "Tue",
                            "open": "11:00 am",
                            "close": "9:30 pm"
                        },
                        {
                            "day": "Wed",
                            "open": "11:00 am",
                            "close": "9:30 pm"
                        },
                        {
                            "day": "Thu",
                            "open": "11:00 am",
                            "close": "9:30 pm"
                        },
                        {
                            "day": "Fri",
                            "open": "11:00 am",
                            "close": "10:30 pm"
                        },
                        {
                            "day": "Sat",
                            "open": "11:00 am",
                            "close": "10:30 pm"
                        },
                        {
                            "day": "Sun",
                            "open": "11:00 am",
                            "close": "9:30 pm"
                        }
                    ],
                    "rating": "3.0",
                    "reviews": 194
                },
                "reputation": {
                    "rating": "3.0",
                    "reviews": 194,
                    "contents": [
                        {
                            "author": "Nijole T.",
                            "avatar": "",
                            "rated": "4.0",
                            "review": "Delicious pizza at Gina's!\nWe all enjoyed the crust and ample toppings, everything is always fresh an made to order.\nAn XL fed our family of 4 with plenty of leftovers, making it a great deal for just under $30.\nService is nice, pizzas ready in about 15 minutes.\nGreat place for a casual lunch or dinner.",
                            "date": "2017-07-25 00:00:00"
                        },
                        {
                            "author": "Michael F.",
                            "avatar": "",
                            "rated": "2.0",
                            "review": "Had small pizza, kids pizza, bruschetta and tomato canters salad. NOT WORTH $50!!!\n\nPizza was just ok. Salad was all spring mix. All food Not much flavor and over priced. \n\nDisappointed",
                            "date": "2017-10-26 00:00:00"
                        },
                        {...},
                        {...}
                    ]
                }
            }
        },
        {
            "client": 12345,
            "partner": 7,
            "link": "https://www.google.com/maps?cid=15412785221185897851",
            "claimed": "true",
            "hours": "true",
            "description": "null",
            "categories": 7,
            "photos": 1,
            "website": "http://www.ginaspizza.com/",
            "n": "Gina's Pizza",
            "a": "3142 W Balboa Blvd, Newport Beach, CA 92663",
            "p": "(949) 723-4462",
            "id": 6945922,
            "createdAt": "2017-12-13T22:08:39.000Z",
            "directory": "google",
            "batch": "3201926-2017-12-13 22:08:39",
            "nScore": 100,
            "aScore": 100,
            "pScore": 100,
            "napScore": 100,
            "data": {
                "cid": "15412785221185897851",
                "description": "",
                "name": "Gina's Pizza",
                "place_url": "https://www.google.com/maps?cid=15412785221185897851",
                "categories": [
                    "pizza restaurant",
                    "deliveries",
                    "fast food container",
                    "italian restaurant",
                    "pizza delivery",
                    "pizza",
                    "western food"
                ],
                "gcid": [
                    "gcid:pizza_restaurant",
                    "gcid:italian_restaurant",
                    "gcid:pizza_delivery_service"
                ],
                "keywords": [
                    "deliveries",
                    "fast food container",
                    "pizza",
                    "western food"
                ],
                "photos": 0,
                "claimed": "yes",
                "reviews": 84,
                "rating": "4.4",
                "address": "3142 W Balboa Blvd, Newport Beach, CA 92663",
                "area_code": "949",
                "business_phone": "(949) 723-4462",
                "website": {
                    "link": "http://www.ginaspizza.com/",
                    "domain": "ginaspizza.com"
                },
                "opening_hours": {
                    "1": {
                        "day": "Monday",
                        "hours": "11AM–10PM"
                    },
                    "2": {
                        "day": "Tuesday",
                        "hours": "11AM–10PM"
                    },
                    "3": {
                        "day": "Wednesday",
                        "hours": "11AM–10PM"
                    },
                    "4": {
                        "day": "Thursday",
                        "hours": "11AM–10PM"
                    },
                    "5": {
                        "day": "Friday",
                        "hours": "11AM–11PM"
                    },
                    "6": {
                        "day": "Saturday",
                        "hours": "11AM–11PM"
                    },
                    "7": {
                        "day": "Sunday",
                        "hours": "11AM–10PM"
                    }
                },
                "place_id": null,
                "is_places": "no",
                "nap": {
                    "n": 100,
                    "a": 100,
                    "p": 100,
                    "t": 100
                }
            }
        },
        {
            "client": 12345,
            "partner": 7,
            "link": "",
            "claimed": "",
            "hours": "false",
            "description": "null",
            "categories": 0,
            "photos": 0,
            "website": "",
            "n": "",
            "a": "",
            "p": "",
            "id": 6945923,
            "createdAt": "2017-12-13T22:08:39.000Z",
            "directory": "yahoo",
            "batch": "3201926-2017-12-13 22:08:39",
            "nScore": 0,
            "aScore": 0,
            "pScore": 0,
            "napScore": 0,
            "data": null
        },
        {
            "client": 12345,
            "partner": 7,
            "link": "http://www.bing.com/local?lid=YN873x105183062",
            "claimed": "null",
            "hours": "null",
            "description": "null",
            "categories": 0,
            "photos": 6,
            "website": "http://ginaspizza.com/",
            "n": "Gina's Pizza",
            "a": "3142 W Balboa Blvd, Newport Beach, CA 92663",
            "p": "(949) 723-4462",
            "id": 6945924,
            "createdAt": "2017-12-13T22:08:39.000Z",
            "directory": "bing",
            "batch": "3201926-2017-12-13 22:08:39",
            "nScore": 100,
            "aScore": 100,
            "pScore": 100,
            "napScore": 100,
            "data": {
                "data": {
                    "present": 1,
                    "photos": 6,
                    "website": "http://ginaspizza.com/",
                    "reviews": 0,
                    "bingpage": "http://www.bing.com/local?lid=YN873x105183062",
                    "napscore": {
                        "nap": {
                            "n": 100,
                            "a": 100,
                            "p": 100
                        },
                        "score": 100
                    },
                    "score": 100
                },
                "nap": [
                    "Gina's Pizza",
                    "3142 W Balboa Blvd, Newport Beach, CA 92663",
                    "(949) 723-4462",
                    "(949) 723-4462",
                    "(949) 723-4462",
                    "http://www.bing.com/local?lid=YN873x105183062"
                ]
            }
        }
    ],
    "total": 4
}