{"id":22683234,"url":"https://github.com/mtchavez/py_al_papi","last_synced_at":"2025-03-29T14:27:55.101Z","repository":{"id":57409901,"uuid":"3752331","full_name":"mtchavez/py_al_papi","owner":"mtchavez","description":"Python Package for AuthorityLabs Partner API","archived":false,"fork":false,"pushed_at":"2012-11-16T21:24:46.000Z","size":115,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T02:09:26.729Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pypi.python.org/pypi/al_papi/0.0.1","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtchavez.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-18T02:23:45.000Z","updated_at":"2013-10-28T23:24:05.000Z","dependencies_parsed_at":"2022-08-24T18:50:50.180Z","dependency_job_id":null,"html_url":"https://github.com/mtchavez/py_al_papi","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fpy_al_papi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fpy_al_papi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fpy_al_papi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fpy_al_papi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtchavez","download_url":"https://codeload.github.com/mtchavez/py_al_papi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246195620,"owners_count":20738909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-09T21:11:20.378Z","updated_at":"2025-03-29T14:27:55.075Z","avatar_url":"https://github.com/mtchavez.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Python Package for AuthorityLabs Partner API\n=============================\n\nA wrapper around the Partner API calls. Allows post, priority post and get calls.\n\n* Github: http://github.com/mtchavez/py_al_papi\n* PyPi: http://pypi.python.org/pypi/al_papi\n* [![endorse](http://api.coderwall.com/mtchavez/endorsecount.png)](http://coderwall.com/mtchavez)\n\n## Install\n\n    pip install al_papi\n\n## Usage\n\nConfigure your api key to be used to make requests:\n\n    import al_papi\n\n    al_papi.Config.setup('yR43BtRDjadfavXy6a4aK3')\n\n### POST\n\nPost your keyword-engine-locale combination to the API once you have set your API key:\n\n    import al_papi\n\n    al_papi.Config.setup('yR43BtRDjadfavXy6a4aK3')\n\n    res = al_papi.Request.post({ \"keyword\" : \"Centaur Stampede\", \"engine\" : \"bing\", \"locale\" : \"en-us\" })\n\n    if res.success\n      print \"Centaur High Hoof\"\"\n    else\n      print \"PAPI Fail\"\n\n### Priority POST\n\nPost your keyword to the priority queue if you need results in a more timely manner:\n\n    import al_papi\n\n    al_papi.Config.setup('yR43BtRDjadfavXy6a4aK3')\n\n    res = al_papi.Request.priority_post({ \"keyword\" : \"Druggie Scientist\", \"engine\" : \"bing\", \"locale\" : \"en-us\" })\n\n    if res.success\n      print \"Scientific Pontification\"\n    else\n      print \"Drugs are bad\"\n\n### GET\n\nWhen you are ready to get your results you can do a GET request for your keyword-engine-locale combo:\n\n    import al_papi\n\n    al_papi.Config.setup('yR43BtRDjadfavXy6a4aK3')\n\n    res = al_papi.Request.priority_post({ \"keyword\" : \"Canadian Wizards\", \"engine\" : \"bing\", \"locale\" : \"en-us\" })\n\n    if res.success\n      print \"Wizardry Is Sexy\"\n    else\n      print \"No magic, eh?\"\n\n\n### Response\n\nWhen making an API request a response object is returned with any errors, http response code and http reponse body.\n\n    import al_papi\n\n    al_papi.Config.setup('yR43BtRDjadfavXy6a4aK3')\n\n    res = al_papi.Request.priority_post({ \"keyword\" : \"Canadian Wizards\", \"engine\" : \"bing\", \"locale\" : \"en-us\" })\n\n    # Errors:\n    # Returns an array of error objects.\n    res.errors\n\n    for err in res.errors:\n      print err.message\n      print err.code\n\n    # Success:\n    # Returns true or false if request was successful or not.\n    res.success\n\n    # Body:\n    # Returns body of response.\n    # On GET requests the body will be a hash of your results if successful.\n    res.body\n\n    # Code:\n    # Returns http response code.\n    # 204: On GET requests when no data is available yet\n    # 200: Successful\n    # 401: Invalid api key\n    # 500: Server Error\n    res.code\n\n    # Over Limit:\n    # Returns true or false if over hourly limit\n    res.over_limit\n\n    # Suspended:\n    # Returns true or false if your account has been suspended\n    res.suspended\n\n## Web Insight\n\n## Description\n\nWeb Insight queue takes a URL for the Partner API to scrape and parse out high level insight about the page\nand return the results to your callback URL passed in or set for your account.\n\n## POST\n\nPost the URL of the page you want to gain insight into and the callback URL knowing when your results are\nready to get.\n\n    import al_papi\n    al_papi.Config.setup('yR43BtRDjadfavXy6a4aK3')\n    res = al_papi.WebInsight.post({\"url\" : \"http://www.qwiki.com\", \"callback\" : \"http://your-callback.com\"})\n\n## GET\n\nWhen your results are ready to get you will receive a callback that contains the information on how\nto get the insight on your URL. In the callback you should receive a date_created and time_created to use\nin your get request. You will also use your original URL posted.\n\n    import al_papi\n    al_papi.Config.setup('yR43BtRDjadfavXy6a4aK3')\n    res = al_papi.WebInsight.post({\"url\" : \"http://www.qwiki.com\", \"date_created\" : \"2012-06-14\", \"time_created\" : \"01:50\"})\n\n## Extras\n\n### Engines\n\nSupported engines are Google, Yahoo and Bing. To get a list of supported engines run the following:\n\n    import al_papi\n\n    al_papi.Engines.all\n\n### Locales\n\nSupported locales differ by the engine being used. In order to make sure you are using a supported locale\nfor the engine you are posting a keyword to there is a locales class to help you:\n\n    import al_papi\n\n    al_papi.Locales.supported # returns an array of locales for the default engine Google\n    al_papi.Locales.supported 'bing' # for other engines pass in the engine name\n    al_papi.Locales.supported 'yahoo'\n\n## License\n\nWritten by Chavez\n\nReleased under the MIT License: http://www.opensource.org/licenses/mit-license.php\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtchavez%2Fpy_al_papi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtchavez%2Fpy_al_papi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtchavez%2Fpy_al_papi/lists"}