是否曾尝试在销售电话前几分钟研究潜在客户,却发现昂贵的数据提供商提供的信息已过时?是的,我也是。这正是我上周末构建一些不同东西的原因。
静态数据的问题?
以下场景可能听起来很熟悉:
您的销售代表即将接听一位热门潜在客户的电话。他们很快在你精美的数据丰富工具中查找该公司,并自信地提到,“我看到你最近筹集了 A 轮融资!”只听一阵尴尬的笑声,“其实那是两年前的事了。我们上个月刚刚结束了 C 轮。”
哎呀。
静态数据库,无论多么全面,都有一个基本缺陷:它们是静态的。当信息被收集、处理和提供时,它通常已经过时了。在快速发展的科技和商业世界中,这是一个真正的问题。
不同的方法?
如果我们不依赖预先收集的数据,可以:
- 从网络上获取实时信息
- 按照我们需要的方式构建它
- 再也不用担心数据新鲜度
这正是我们今天要使用 Linkup 的 API 构建的。最好的部分?只需 50 行 Python 代码。
让我们来构建它吧! ?
是时候编写一些代码了!但别担心 - 我们会将其分解成小块,即使您的非技术同事也能理解(嗯,几乎?)。
1. 建立我们的项目?
首先,让我们创建我们的项目并安装我们需要的工具:
mkdir company-intel cd company-intel pip install linkup-sdk pydantic
这里没什么特别的 - 只需创建一个新文件夹并安装我们的两个神奇成分:用于获取数据的 linkup-sdk 和用于确保我们的数据看起来漂亮的 pydantic。
2. 定义我们想知道什么?
在开始获取数据之前,让我们先定义一下我们真正想了解的公司哪些内容。将此视为您的愿望清单:
# schema.py - Our data wishlist! ? from pydantic import BaseModel from typing import List, Optional from enum import Enum class CompanyInfo(BaseModel): # The basics name: str = "" # Company name (duh!) website: str = "" # Where they live on the internet description: str = "" # What they do (hopefully not just buzzwords) # The interesting stuff latest_funding: str = "" # Show me the money! ? recent_news: List[str] = [] # What's the buzz? ? leadership_team: List[str] = [] # Who's running the show? ? tech_stack: List[str] = [] # The tools they love ⚡
这就像告诉餐厅你到底想在三明治中添加什么。我们正在使用 pydantic 来确保我们得到的正是我们订购的东西!
3. 魔法机器?✨
现在到了有趣的部分 - 让一切正常工作的引擎:
# company_intel.py - Where the magic happens! ? from linkup import LinkupClient from schema import CompanyInfo from typing import List class CompanyIntelligence: def __init__(self, api_key: str): # Initialize our crystal ball (aka Linkup client) self.client = LinkupClient(api_key=api_key) def research_company(self, company_name: str) -> CompanyInfo: # Craft our research question query = f""" Hey Linkup! Tell me everything fresh about {company_name}: ? The name of the company, its website, and a short description. ? Any recent funding rounds or big announcements? ? Who's on the leadership team right now? ?️ What tech are they using these days? ? What have they been up to lately? PS: Only stuff from the last 3 months, please! """ # Ask the question and get structured answers response = self.client.search( query=query, # What we want to know depth="deep", # Go deep, not shallow output_type="structured", # Give me clean data structured_output_schema=CompanyInfo # Format it like our wishlist ) return response
让我们来分解一下这里发生的事情:
- 我们创建一个新的 CompanyIntelligence 类(名字很奇特,对吧?)
- 用我们的API密钥(王国的钥匙)初始化它
- 定义一个方法,该方法接受公司名称并返回所有有趣的详细信息
- 编写一个友好的查询,准确地告诉 Linkup 我们想要什么
- 获取与我们的愿望清单相匹配的干净、结构化的数据
4. 使其投入生产?
现在让我们将其包装在一个很好的 API 中,供整个团队使用:
mkdir company-intel cd company-intel pip install linkup-sdk pydantic
这里有什么很酷的:
- FastAPI 使我们的工具可以通过 HTTP 访问(太棒了!)
- 任何人都可以使用的简单 GET 端点
5. 让我们来试一试吧! ?
是时候看看我们的创作如何发挥作用了:
# schema.py - Our data wishlist! ? from pydantic import BaseModel from typing import List, Optional from enum import Enum class CompanyInfo(BaseModel): # The basics name: str = "" # Company name (duh!) website: str = "" # Where they live on the internet description: str = "" # What they do (hopefully not just buzzwords) # The interesting stuff latest_funding: str = "" # Show me the money! ? recent_news: List[str] = [] # What's the buzz? ? leadership_team: List[str] = [] # Who's running the show? ? tech_stack: List[str] = [] # The tools they love ⚡
瞧!新鲜、实时的公司数据触手可及!
6. 有趣的扩展?
想让它变得更酷吗?您可以添加以下一些有趣的内容:
# company_intel.py - Where the magic happens! ? from linkup import LinkupClient from schema import CompanyInfo from typing import List class CompanyIntelligence: def __init__(self, api_key: str): # Initialize our crystal ball (aka Linkup client) self.client = LinkupClient(api_key=api_key) def research_company(self, company_name: str) -> CompanyInfo: # Craft our research question query = f""" Hey Linkup! Tell me everything fresh about {company_name}: ? The name of the company, its website, and a short description. ? Any recent funding rounds or big announcements? ? Who's on the leadership team right now? ?️ What tech are they using these days? ? What have they been up to lately? PS: Only stuff from the last 3 months, please! """ # Ask the question and get structured answers response = self.client.search( query=query, # What we want to know depth="deep", # Go deep, not shallow output_type="structured", # Give me clean data structured_output_schema=CompanyInfo # Format it like our wishlist ) return response
现实世界的影响?
我们一直在销售团队的生产中使用它,它改变了游戏规则:
- 通话前研究始终是最新的
- 销售代表对他们的外展更有信心
- 我们及时了解重要的公司动态
- 我们的数据实际上随着时间的推移变得更好,而不是更差
为什么这很重要?
- 始终新鲜:信息是实时收集的,而不是从静态数据库中提取
- 全面:结合网络上多个来源的数据
- 可定制:完全按照您的团队需要的方式构建数据
- 高效:足够快,可以在调用前进行实时查找
- 可维护:任何开发人员都可以理解和修改的简单代码
未来的想法?
可能性是无限的!以下是一些进一步推进的想法:
对于销售团队:
- 用于即时查找的 Slack 机器人(/研究公司名称)
- Chrome 扩展程序,可在 LinkedIn 上显示公司信息
- 自动 CRM 丰富
对于营销团队:
- 跟踪竞争对手的内容策略
- 监控行业趋势
- 确定潜在的合作机会
对于产品团队:
- 跟踪竞争对手的功能发布
- 监控客户技术堆栈
- 识别整合机会
自己尝试一下?️
准备好构建自己的了吗?这是您需要的:
- 获取链接 API 密钥
- 复制上面的代码
- 根据您的需求自定义架构
- 部署并享受始终新鲜的公司数据!
总结一下?
静态数据库的日子已经屈指可数了。在公司一夜之间转型、每周融资、每月更换技术堆栈的世界里,拥有实时情报不仅是件好事,而且是必不可少的。
我们在这里建造的只是一个开始。想象一下将其与:
结合起来- 人工智能自动洞察
- 跨行业趋势检测
- 公司发展的预测分析
你建造过类似的东西吗?您如何应对保持公司数据最新的挑战?请在评论中告诉我!
python #api #saas #webdev #buildinpublic
建立在 ☕ 和对新鲜数据的健康痴迷
以上是使用 Python 行链接构建实时公司智能引擎的详细内容。更多信息请关注PHP中文网其他相关文章!

Tomergelistsinpython,YouCanusethe操作员,estextMethod,ListComprehension,Oritertools

在Python3中,可以通过多种方法连接两个列表:1)使用 运算符,适用于小列表,但对大列表效率低;2)使用extend方法,适用于大列表,内存效率高,但会修改原列表;3)使用*运算符,适用于合并多个列表,不修改原列表;4)使用itertools.chain,适用于大数据集,内存效率高。

使用join()方法是Python中从列表连接字符串最有效的方法。1)使用join()方法高效且易读。2)循环使用 运算符对大列表效率低。3)列表推导式与join()结合适用于需要转换的场景。4)reduce()方法适用于其他类型归约,但对字符串连接效率低。完整句子结束。

pythonexecutionistheprocessoftransformingpypythoncodeintoExecutablestructions.1)InternterPreterReadSthecode,ConvertingTingitIntObyTecode,whepythonvirtualmachine(pvm)theglobalinterpreterpreterpreterpreterlock(gil)the thepythonvirtualmachine(pvm)

Python的关键特性包括:1.语法简洁易懂,适合初学者;2.动态类型系统,提高开发速度;3.丰富的标准库,支持多种任务;4.强大的社区和生态系统,提供广泛支持;5.解释性,适合脚本和快速原型开发;6.多范式支持,适用于各种编程风格。

Python是解释型语言,但也包含编译过程。1)Python代码先编译成字节码。2)字节码由Python虚拟机解释执行。3)这种混合机制使Python既灵活又高效,但执行速度不如完全编译型语言。

useeAforloopWheniteratingOveraseQuenceOrforAspecificnumberoftimes; useAwhiLeLoopWhenconTinuingUntilAcIntiment.ForloopSareIdeAlforkNownsences,而WhileLeleLeleLeleLoopSituationSituationSituationsItuationSuationSituationswithUndEtermentersitations。

pythonloopscanleadtoerrorslikeinfiniteloops,modifyingListsDuringteritation,逐个偏置,零indexingissues,andnestedloopineflinefficiencies


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

PhpStorm Mac 版本
最新(2018.2.1 )专业的PHP集成开发工具

Dreamweaver CS6
视觉化网页开发工具

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

WebStorm Mac版
好用的JavaScript开发工具