我试图从PatentsView中获取多个组织的专利。示例可在http://www.patentsview.org/api/query-language.html
这是我的问题:
import csv
import requests
import json
# Use this format for GET requests
url = 'http://www.patentsview.org/api/patents/query?q={"_and":[{"inventor_last_name":"Jobs"},{"assignee_lastknown_country":"US"}]}&f=["patent_number"]'
# This format is for POST
url1 = 'http://www.patentsview.org/api/patents/query'
# String contains the value string (http://www.patentsview.org/api/query-language.html)
body = '{"q":{"_contains":{"assignee_organization":["Samsung","Apple"]}},"f":["assignee_organization"]}'
url2 = 'http://www.patentsview.org/api/patents/query?q={"_contains": {"assignee_organization":["Samsung","Apple"]}}&f=["assignee_organization","patent_number","patent_title"]'
r = requests.get(url2)
# r = requests.post(url1,body)
print r.text
查询的输出是:
{"patents":[{"patent_number":"4221975","patent_title":"Touch activated controller and method","assignees":[{"assignee_organization":"Touch Activated Switch Arrays, Inc."}]},{"patent_number":"4288786","patent_title":"Touch sensing keyboard construction","assignees":[{"assignee_organization":"Touch Activated Switch Arrays, Inc."}]},{"patent_number":"4321479","patent_title":"Touch activated controller and method","assignees":[{"assignee_organization":"Touch Activated Switch Arrays, Inc."}]},{"patent_number":"4455452","patent_title":"Touch activated controller for generating X-Y output information","assignees":[{"assignee_organization":"Touch Activated Switch Arrays, Inc."}]},{"patent_number":"4689657","patent_title":"IC interconnect system using metal as a mask","assignees":[{"assignee_organization":"Lasarray Holding AG"}]},{"patent_number":"4691434","patent_title":"Method of making electrically conductive regions in monolithic semiconductor devices as applied to a semiconductor device","assignees":[{"assignee_organization":"Lasarray Holding AG"}]},{"patent_number":"4695698","patent_title":"Method of, and apparatus for, generating a predetermined pattern using laser radiation","assignees":[{"assignee_organization":"Lasarray Holding AG"}]},{"patent_number":"4695986","patent_title":"Ultrasonic transducer component and process for making the same and assembly","assignees":[{"assignee_organization":"Ultrasonic Arrays, Inc."}]},{"patent_number":"4733222","patent_title":"Capacitance-variation-sensitive touch sensing array system","assignees":[{"assignee_organization":"Integrated Touch Arrays, Inc."}]},{"patent_number":"4769793","patent_title":"Dual reference surface transducer","assignees":[{"assignee_organization":"Ultrasonic Arrays, Inc."}]},{"patent_number":"4790438","patent_title":"Electrical component sequential testing apparatus","assignees":[{"assignee_organization":"Array Instruments, Inc."}]},{"patent_number":"4809014","patent_title":"Apparatus for and method of positioning and synchronizing a writing laser beam","assignees":[{"assignee_organization":"Lasarray Holding AG"}]},{"patent_number":"4823590","patent_title":"Automatic calibration method for thickness gauges","assignees":[{"assignee_organization":"Ultrasonic Arrays, Inc."}]},{"patent_number":"4871896","patent_title":"Process and device to enhance system performance accuracy in a laser writing process","assignees":[{"assignee_organization":"Lasarray Holding AG"}]},{"patent_number":"4882657","patent_title":"Pin grid array assembly","assignees":[{"assignee_organization":"ICI Array Technology, Inc."}]},{"patent_number":"4887246","patent_title":"Ultrasonic apparatus, system and method","assignees":[{"assignee_organization":"Ultrasonic Arrays, Inc."}]},{"patent_number":"4888086","patent_title":"Ultrasonic method","assignees":[{"assignee_organization":"Ultrasonic Arrays, Inc."}]},{"patent_number":"4955225","patent_title":"Automatic calibration method for thickness gauges","assignees":[{"assignee_organization":"Ultrasonic Arrays, Inc."}]},{"patent_number":"5001714","patent_title":"Unpredictable fault detection using adaptive inference testing techniques","assignees":[{"assignee_organization":"Array Analysis, Inc."}]},{"patent_number":"5020011","patent_title":"System for displaying adaptive inference testing device information","assignees":[{"assignee_organization":"Array Analysis, Inc."}]},{"patent_number":"5029079","patent_title":"Apparatus and method for flexible control of digital signal processing devices","assignees":[{"assignee_organization":"Array Microsystems, Inc."}]},{"patent_number":"5043987","patent_title":"Method for calculating adaptive inference test figure of merit","assignees":[{"assignee_organization":"Array Analysis, Inc."}]},{"patent_number":"5046034","patent_title":"Array structure for use in an adaptive inference testing device","assignees":[{"assignee_organization":"Array Analysis, Inc."}]},{"patent_number":"5050173","patent_title":"Looped, phased array laser oscillator","assignees":[{"assignee_organization":"Phased Array Lasers Pty Ltd."}]},{"patent_number":"5068814","patent_title":"Interactive adaptive inference system","assignees":[{"assignee_organization":"Array Analysis, Inc."}]}],"count":25,"total_patent_count":601}
出于某种原因,服务器似乎在
assignee organization
名称中考虑了“array”。用一个公司名称运行相同的请求似乎可以正常工作。解决这个问题的好办法是什么?
最佳答案
patentsview dev,谢谢你提出来!我们发现带有_contains运算符的列表参数错误,现在您的原始api调用应该给出正确的响应:
http://www.patentsview.org/api/patents/query?q={"_contains":{"assignee_organization":["Samsung","Apple"]}}
关于python - 查询PatentsView中多个受让人组织的专利,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41686536/