跳转到主要内容

Website Contacts API的Python客户端库。

项目描述

website-contacts-py license website-contacts-py release website-contacts-py build

概述

Python语言的Website Contacts API客户端库。

最低Python版本是3.6。

安装

pip install website-contacts

示例

完整的API文档可在此处找到 这里

创建新的客户端

from websitecontacts import *

client = Client('Your API key')

制作基本请求

# Get contacts for a domain name.
response = client.get('youtube.com')
print(response)

# Get raw API response in XML format
raw_result = client.get_raw('bbc.com',
    output_format=Client.XML_FORMAT)

高级使用

额外的请求参数

result = client.get(
    'samsung.com',
    hard_refresh=True)

响应模型概述

Response:
    - company_names: [str]
    - country_code: str
    - domain_name: str
    - emails: [Email]
        - description: str
        - email: str
    - meta_description: str
    - meta_title: str
    - phones: [Phone]
        - call_hours: str
        - description: str
        - phone_number: str
    - postal_addresses: [str]
    - social_facebook: str
    - social_instagram: str
    - social_linkedin: str
    - social_twitter: str
    - website_responded: bool

示例响应

{
'company_names': [
                   'Samsung Electronics Co. Ltd',
                   'Samsung Electronics America Inc',
                   'Samsung-Sanyo Electronics',
                   'Samsung Electronics Industry Co Ltd',
                   'Samsung US'],
'country_code': 'KR',
'domain_name': 'samsung.com',
'emails': [ {'description': '', 'email': 'ssvoc@samsung.com'},
            {'description': '', 'email': 'eco.sec@samsung.com'},
            {'description': '', 'email': 'ircontactus@samsung.com'}],
'meta_description': 'Discover the latest in electronic & smart appliance '
                    'technology with Samsung. Find the next big thing from '
                    'smartphones & tablets to laptops & tvs & more.',
'meta_title': 'Samsung US | Mobile | TV | Home Electronics | Home Appliances '
              '| Samsung US',
'phones': [ {'call_hours': '', 'description': '', 'phone_number': '24 36 40'},
            {'call_hours': '', 'description': '', 'phone_number': '82-2-2255-9000'},
            {'call_hours': '8 AM - 12 AM EST 7 days a week IT/ Computing 8 AM to 9 PM EST Mon to Fri', 'description': '', 'phone_number': '1-800-SAMSUNG 726-7864'}],
'postal_addresses': [],
'social_facebook': 'https://#/SamsungUS',
'social_instagram': 'https://instagram.com/samsungusa',
'social_linkedin': '',
'social_twitter': 'https://twitter.com/SamsungUS',
'website_responded': True
}

变更日志

1.0.0 (2021-09-17)

  • 首次发布

项目详情


下载文件

下载适合您的平台文件。如果您不确定选择哪个,请了解更多关于安装软件包的信息。

源分布

website-contacts-1.0.0.tar.gz (9.6 kB 查看哈希值)

上传时间 源码

构建版本

website_contacts-1.0.0-py3-none-any.whl (10.5 kB 查看哈希值)

上传时间 Python 3

由以下支持