I am trying to fetch patents of multiple organizations from PatentsView. Examples are available at http://www.patentsview.org/api/query-language.html
This is my query:
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
The output from the query is:
{"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}
For some reason, the server appears to consider 'Array' in assignee organization
name. Running the same request with a single company name appears to work fine.
What is a good way to resolve the issue?
PatentsView dev here, thanks for bringing this up! We found the list argument error with the _contains operator and now your original API call should give the correct response: