Search.jsp returning blank data when searching for size

I’m trying to further improve my .NET library for handling api calls to PVOutput.org and I’ve run in to a problem.

It appears there are search queries I can do in the “Find”-box on the site, that do not work when done through the api. For example the following query works on the site: 4250 size, but if I try it through the api call:

https://pvoutput.org/service/r2/search.jsp?q=4250 size (the space is encoded to %20)

The result is two blank lines. Obviously the api key and my own system are in the headers. I haven’t yet tested every query parameter but the orientation query (fronius +N) appears to have the same problem. I thought the space character was the problem, but a query like 92 postcode works like expected so that’s not the cause. It seems query parameter related.

Am I doing something wrong or is there some bug in this part of the api?

Give it another try.

1 Like

Thanks BB, the “4250 size” query appears to work as expected now. :+1:

However the https://pvoutput.org/service/r2/search.jsp?q=fronius +N does not. It has the same symptoms as the size-query had.

Using Postman I’ve tested the rest of the search methods I’m implementing. I’ve found some other queries that do not seem to work (return empty results sets in every case):
https://pvoutput.org/service/r2/search.jsp?q=morra +E (query by name and orientation)
https://pvoutput.org/service/r2/search.jsp?q=53 tilt (query by tilt)
https://pvoutput.org/service/r2/search.jsp?q=9200 25km (distance query with postcode)

And one query that works different as expected:
https://pvoutput.org/service/r2/search.jsp?q=660 (query by postcode or size)
it seems to ignore postcodes altogether. It also returns by size.

I hope I’m not bothering you with these things :smile: These api methods are probably not used that often, but I’m aiming for 100% api coverage in my library so I try them all.

  1. The “+” will need to be encoded as “%2B” otherwise they will be translated to spaces.

q=morra +E`

Should be -

q=morra%20%2BE

  1. Tilt queries have been added to the service API

  2. For postcode distance searches, add country_code parameter

q=9200%2025km&country_code=nl

1 Like

Thanks for your fast reply!

And you are right about the +. Apparently Postman (the tool I use for testing api calls) encodes all characters properly except for +. My mistake, I should’ve checked that. So queries by orientation, tilt and postcode/distance are now working as intended. I can finish the implementation for those queries in the library.

Did you also look at the query by a single numeric value (postcode or size, the api documentation calls it)? That one still only seems to search by system size, never postcode. I don’t mind leaving that call out for now, as it’s usage seems limited but I still wanted to mention it.

This should now be working as expected, thanks for reporting these issues.

1 Like

I did a quick test and https://pvoutput.org/service/r2/search.jsp?q=660 now also returns systems with a system size that does not start with 660 but a postcode that does. Everything seems to work as expected.

Thank you for solving them so quickly :slight_smile: